home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: Reference2.tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Corel 10 Texture (image/corel10Texture)
| ext
| Unsupported |
1%
| dexvert
| Croteam texture file (image/croteamTextureFile)
| ext
| Unsupported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| text/x-matlab
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 0a 25 20 53 54 6b 20 | 52 65 66 65 72 65 6e 63 |%.% STk |Referenc|
|00000010| 65 20 6d 61 6e 75 61 6c | 20 28 50 61 72 74 20 32 |e manual| (Part 2|
|00000020| 29 0a 25 0a 25 20 20 20 | 20 20 20 20 20 20 20 20 |).%.% | |
|00000030| 41 75 74 68 6f 72 3a 20 | 45 72 69 63 6b 20 47 61 |Author: |Erick Ga|
|00000040| 6c 6c 65 73 69 6f 20 5b | 65 67 40 75 6e 69 63 65 |llesio [|eg@unice|
|00000050| 2e 66 72 5d 0a 25 20 20 | 20 20 43 72 65 61 74 69 |.fr].% | Creati|
|00000060| 6f 6e 20 64 61 74 65 3a | 20 3f 3f 2d 4e 6f 76 2d |on date:| ??-Nov-|
|00000070| 31 39 39 33 20 3f 3f 3a | 3f 3f 0a 25 20 4c 61 73 |1993 ??:|??.% Las|
|00000080| 74 20 66 69 6c 65 20 75 | 70 64 61 74 65 3a 20 32 |t file u|pdate: 2|
|00000090| 33 2d 4a 75 6c 2d 31 39 | 39 36 20 30 38 3a 35 39 |3-Jul-19|96 08:59|
|000000a0| 0a 25 0a 0a 25 25 25 25 | 25 25 25 25 25 25 25 25 |.%..%%%%|%%%%%%%%|
|000000b0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000000c0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000000d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000000e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000000f0| 25 25 0a 25 25 25 25 0a | 25 25 25 25 20 53 65 63 |%%.%%%%.|%%%% Sec|
|00000100| 74 69 6f 6e 20 36 2e 31 | 31 20 4b 65 79 77 6f 72 |tion 6.1|1 Keywor|
|00000110| 64 73 0a 25 25 25 25 0a | 25 25 25 25 25 25 25 25 |ds.%%%%.|%%%%%%%%|
|00000120| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000130| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000140| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000150| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000160| 25 25 25 25 25 25 0a 0a | 5c 73 75 62 73 65 63 74 |%%%%%%..|\subsect|
|00000170| 69 6f 6e 7b 4b 65 79 77 | 6f 72 64 73 7d 0a 5c 6c |ion{Keyw|ords}.\l|
|00000180| 61 62 65 6c 7b 6b 65 79 | 77 6f 72 64 73 7d 0a 0a |abel{key|words}..|
|00000190| 4b 65 79 77 6f 72 64 73 | 20 61 72 65 20 73 79 6d |Keywords| are sym|
|000001a0| 62 6f 6c 69 63 20 63 6f | 6e 73 74 61 6e 74 73 20 |bolic co|nstants |
|000001b0| 77 68 69 63 68 20 65 76 | 61 6c 75 61 74 65 20 74 |which ev|aluate t|
|000001c0| 6f 20 74 68 65 6d 73 65 | 6c 76 65 73 2e 20 41 20 |o themse|lves. A |
|000001d0| 6b 65 79 77 6f 72 64 20 | 6d 75 73 74 0a 62 65 67 |keyword |must.beg|
|000001e0| 69 6e 20 77 69 74 68 20 | 61 20 63 6f 6c 6f 6e 2e |in with |a colon.|
|000001f0| 0a 0a 5c 62 65 67 69 6e | 7b 65 6e 74 72 79 7d 7b |..\begin|{entry}{|
|00000200| 25 0a 5c 70 72 6f 74 6f | 7b 6b 65 79 77 6f 72 64 |%.\proto|{keyword|
|00000210| 3f 7d 7b 20 6f 62 6a 7d | 7b 70 72 6f 63 65 64 75 |?}{ obj}|{procedu|
|00000220| 72 65 7d 7d 0a 5c 73 61 | 75 74 0a 52 65 74 75 72 |re}}.\sa|ut.Retur|
|00000230| 6e 73 20 7b 5c 73 63 68 | 74 72 75 65 7d 20 69 66 |ns {\sch|true} if|
|00000240| 20 5c 76 61 72 7b 6f 62 | 6a 7d 20 69 73 20 61 20 | \var{ob|j} is a |
|00000250| 6b 65 79 77 6f 72 64 2c | 20 6f 74 68 65 72 77 69 |keyword,| otherwi|
|00000260| 73 65 20 72 65 74 75 72 | 6e 73 20 7b 5c 73 63 68 |se retur|ns {\sch|
|00000270| 66 61 6c 73 65 7d 2e 0a | 5c 65 6e 64 7b 65 6e 74 |false}..|\end{ent|
|00000280| 72 79 7d 0a 0a 5c 62 65 | 67 69 6e 7b 65 6e 74 72 |ry}..\be|gin{entr|
|00000290| 79 7d 7b 25 0a 5c 70 72 | 6f 74 6f 7b 6d 61 6b 65 |y}{%.\pr|oto{make|
|000002a0| 2d 6b 65 79 77 6f 72 64 | 7d 7b 20 6f 62 6a 7d 7b |-keyword|}{ obj}{|
|000002b0| 70 72 6f 63 65 64 75 72 | 65 7d 7d 0a 5c 73 61 75 |procedur|e}}.\sau|
|000002c0| 74 0a 42 75 69 6c 64 73 | 20 61 20 6b 65 79 77 6f |t.Builds| a keywo|
|000002d0| 72 64 20 66 72 6f 6d 20 | 74 68 65 20 67 69 76 65 |rd from |the give|
|000002e0| 6e 20 5c 76 61 72 7b 6f | 62 6a 7d 2e 20 5c 76 61 |n \var{o|bj}. \va|
|000002f0| 72 7b 6f 62 6a 7d 20 6d | 75 73 74 20 62 65 20 61 |r{obj} m|ust be a|
|00000300| 20 73 79 6d 62 6f 6c 0a | 6f 72 20 61 20 73 74 72 | symbol.|or a str|
|00000310| 69 6e 67 2e 20 41 20 63 | 6f 6c 6f 6e 20 69 73 20 |ing. A c|olon is |
|00000320| 61 75 74 6f 6d 61 74 69 | 63 61 6c 6c 79 20 70 72 |automati|cally pr|
|00000330| 65 70 65 6e 64 65 64 2e | 0a 5c 62 65 67 69 6e 7b |epended.|.\begin{|
|00000340| 73 63 68 65 6d 65 7d 0a | 28 6d 61 6b 65 2d 6b 65 |scheme}.|(make-ke|
|00000350| 79 77 6f 72 64 20 22 74 | 65 73 74 22 29 20 20 20 |yword "t|est") |
|00000360| 20 5c 6c 65 76 20 3a 74 | 65 73 74 0a 28 6d 61 6b | \lev :t|est.(mak|
|00000370| 65 2d 6b 65 79 77 6f 72 | 64 20 27 74 65 73 74 29 |e-keywor|d 'test)|
|00000380| 20 20 20 20 20 5c 6c 65 | 76 20 3a 74 65 73 74 0a | \le|v :test.|
|00000390| 28 6d 61 6b 65 2d 6b 65 | 79 77 6f 72 64 20 22 3a |(make-ke|yword ":|
|000003a0| 68 65 6c 6c 6f 22 29 20 | 20 5c 6c 65 76 20 3a 3a |hello") | \lev ::|
|000003b0| 68 65 6c 6c 6f 0a 5c 65 | 6e 64 7b 73 63 68 65 6d |hello.\e|nd{schem|
|000003c0| 65 7d 0a 5c 65 6e 64 7b | 65 6e 74 72 79 7d 0a 0a |e}.\end{|entry}..|
|000003d0| 5c 62 65 67 69 6e 7b 65 | 6e 74 72 79 7d 7b 25 0a |\begin{e|ntry}{%.|
|000003e0| 5c 70 72 6f 74 6f 7b 6b | 65 79 77 6f 72 64 2d 3e |\proto{k|eyword->|
|000003f0| 73 74 72 69 6e 67 7d 7b | 20 6b 65 79 77 6f 72 64 |string}{| keyword|
|00000400| 7d 7b 70 72 6f 63 65 64 | 75 72 65 7d 7d 0a 5c 73 |}{proced|ure}}.\s|
|00000410| 61 75 74 0a 52 65 74 75 | 72 6e 73 20 74 68 65 20 |aut.Retu|rns the |
|00000420| 6e 61 6d 65 20 6f 66 20 | 5c 76 61 72 7b 6b 65 79 |name of |\var{key|
|00000430| 77 6f 72 64 7d 20 61 73 | 20 61 20 73 74 72 69 6e |word} as| a strin|
|00000440| 67 2e 20 54 68 65 20 6c | 65 61 64 69 6e 67 20 63 |g. The l|eading c|
|00000450| 6f 6c 6f 6e 20 69 73 0a | 69 6e 63 6c 75 64 65 64 |olon is.|included|
|00000460| 20 69 6e 20 74 68 65 20 | 72 65 73 75 6c 74 2e 20 | in the |result. |
|00000470| 25 25 20 20 20 20 20 61 | 78 65 3a 20 77 68 79 20 |%% a|xe: why |
|00000480| 74 68 69 73 20 61 73 79 | 6d 6d 65 74 72 79 20 3f |this asy|mmetry ?|
|00000490| 0a 5c 62 65 67 69 6e 7b | 73 63 68 65 6d 65 7d 0a |.\begin{|scheme}.|
|000004a0| 28 6b 65 79 77 6f 72 64 | 2d 3e 73 74 72 69 6e 67 |(keyword|->string|
|000004b0| 20 3a 74 65 73 74 29 20 | 20 20 20 5c 6c 65 76 20 | :test) | \lev |
|000004c0| 22 3a 74 65 73 74 22 0a | 5c 65 6e 64 7b 73 63 68 |":test".|\end{sch|
|000004d0| 65 6d 65 7d 0a 5c 65 6e | 64 7b 65 6e 74 72 79 7d |eme}.\en|d{entry}|
|000004e0| 0a 0a 25 25 20 61 78 65 | 3a 20 61 64 64 65 64 20 |..%% axe|: added |
|000004f0| 64 65 73 63 72 69 70 74 | 69 6f 6e 20 6f 66 20 6c |descript|ion of l|
|00000500| 69 73 74 27 73 20 66 6f | 72 6d 61 74 2e 20 28 70 |ist's fo|rmat. (p|
|00000510| 72 6f 70 6f 73 61 6c 73 | 20 66 6f 72 20 62 65 74 |roposals| for bet|
|00000520| 74 65 72 0a 25 25 20 70 | 68 72 61 73 69 6e 67 20 |ter.%% p|hrasing |
|00000530| 61 72 65 20 77 65 6c 63 | 6f 6d 65 29 0a 5c 62 65 |are welc|ome).\be|
|00000540| 67 69 6e 7b 65 6e 74 72 | 79 7d 7b 25 0a 5c 70 72 |gin{entr|y}{%.\pr|
|00000550| 6f 74 6f 7b 67 65 74 2d | 6b 65 79 77 6f 72 64 7d |oto{get-|keyword}|
|00000560| 7b 20 6b 65 79 77 6f 72 | 64 20 6c 69 73 74 7d 7b |{ keywor|d list}{|
|00000570| 70 72 6f 63 65 64 75 72 | 65 7d 0a 5c 70 72 6f 74 |procedur|e}.\prot|
|00000580| 6f 7b 67 65 74 2d 6b 65 | 79 77 6f 72 64 7d 7b 20 |o{get-ke|yword}{ |
|00000590| 6b 65 79 77 6f 72 64 20 | 6c 69 73 74 20 64 65 66 |keyword |list def|
|000005a0| 61 75 6c 74 7d 7b 70 72 | 6f 63 65 64 75 72 65 7d |ault}{pr|ocedure}|
|000005b0| 7d 0a 5c 73 61 75 74 0a | 0a 5c 76 61 72 7b 4c 69 |}.\saut.|.\var{Li|
|000005c0| 73 74 7d 20 6d 75 73 74 | 20 62 65 20 61 20 6c 69 |st} must| be a li|
|000005d0| 73 74 20 6f 66 20 6b 65 | 79 77 6f 72 64 73 20 61 |st of ke|ywords a|
|000005e0| 6e 64 20 74 68 65 69 72 | 20 72 65 73 70 65 63 74 |nd their| respect|
|000005f0| 69 76 65 20 76 61 6c 75 | 65 73 2e 0a 5c 69 64 65 |ive valu|es..\ide|
|00000600| 7b 47 65 74 2d 6b 65 79 | 77 6f 72 64 7d 20 73 63 |{Get-key|word} sc|
|00000610| 61 6e 73 20 74 68 65 20 | 5c 76 61 72 7b 6c 69 73 |ans the |\var{lis|
|00000620| 74 7d 20 61 6e 64 20 72 | 65 74 75 72 6e 73 20 74 |t} and r|eturns t|
|00000630| 68 65 20 76 61 6c 75 65 | 0a 61 73 73 6f 63 69 61 |he value|.associa|
|00000640| 74 65 64 20 77 69 74 68 | 20 74 68 65 20 67 69 76 |ted with| the giv|
|00000650| 65 6e 20 5c 76 61 72 7b | 6b 65 79 77 6f 72 64 7d |en \var{|keyword}|
|00000660| 2e 20 20 49 66 20 74 68 | 65 20 5c 76 61 72 7b 6b |. If th|e \var{k|
|00000670| 65 79 77 6f 72 64 7d 20 | 64 6f 65 73 0a 6e 6f 74 |eyword} |does.not|
|00000680| 20 61 70 70 65 61 72 20 | 69 6e 20 61 6e 20 6f 64 | appear |in an od|
|00000690| 64 20 70 6f 73 69 74 69 | 6f 6e 20 69 6e 20 5c 76 |d positi|on in \v|
|000006a0| 61 72 7b 6c 69 73 74 7d | 2c 20 74 68 65 20 73 70 |ar{list}|, the sp|
|000006b0| 65 63 69 66 69 65 64 0a | 5c 76 61 72 7b 64 65 66 |ecified.|\var{def|
|000006c0| 61 75 6c 74 7d 20 69 73 | 20 72 65 74 75 72 6e 65 |ault} is| returne|
|000006d0| 64 2c 20 6f 72 20 61 6e | 20 65 72 72 6f 72 20 69 |d, or an| error i|
|000006e0| 73 20 72 61 69 73 65 64 | 20 69 66 20 6e 6f 20 64 |s raised| if no d|
|000006f0| 65 66 61 75 6c 74 20 77 | 61 73 0a 73 70 65 63 69 |efault w|as.speci|
|00000700| 66 69 65 64 2e 0a 5c 62 | 65 67 69 6e 7b 73 63 68 |fied..\b|egin{sch|
|00000710| 65 6d 65 7d 0a 28 67 65 | 74 2d 6b 65 79 77 6f 72 |eme}.(ge|t-keywor|
|00000720| 64 20 3a 6f 6e 65 20 27 | 28 3a 6f 6e 65 20 31 20 |d :one '|(:one 1 |
|00000730| 3a 74 77 6f 20 32 29 29 | 20 5c 6c 65 76 20 31 0a |:two 2))| \lev 1.|
|00000740| 28 67 65 74 2d 6b 65 79 | 77 6f 72 64 20 3a 66 6f |(get-key|word :fo|
|00000750| 75 72 20 27 28 3a 6f 6e | 65 20 31 20 3a 74 77 6f |ur '(:on|e 1 :two|
|00000760| 20 32 29 20 5c 73 63 68 | 66 61 6c 73 65 29 20 5c | 2) \sch|false) \|
|00000770| 6c 65 76 20 5c 73 63 68 | 66 61 6c 73 65 0a 28 67 |lev \sch|false.(g|
|00000780| 65 74 2d 6b 65 79 77 6f | 72 64 20 3a 66 6f 75 72 |et-keywo|rd :four|
|00000790| 20 27 28 3a 6f 6e 65 20 | 31 20 3a 74 77 6f 20 32 | '(:one |1 :two 2|
|000007a0| 29 29 20 5c 6c 65 76 20 | 5c 73 63 68 65 72 72 6f |)) \lev |\scherro|
|000007b0| 72 0a 5c 65 6e 64 7b 73 | 63 68 65 6d 65 7d 0a 5c |r.\end{s|cheme}.\|
|000007c0| 65 6e 64 7b 65 6e 74 72 | 79 7d 0a 0a 0a 0a 25 25 |end{entr|y}....%%|
|000007d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000007e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000007f0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000800| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000810| 25 25 25 25 25 25 25 25 | 25 25 25 25 0a 25 25 25 |%%%%%%%%|%%%%.%%%|
|00000820| 25 0a 25 25 25 25 20 53 | 65 63 74 69 6f 6e 20 36 |%.%%%% S|ection 6|
|00000830| 2e 31 32 3a 20 54 6b 20 | 63 6f 6d 6d 61 6e 64 73 |.12: Tk |commands|
|00000840| 0a 25 25 25 25 0a 25 25 | 25 25 25 25 25 25 25 25 |.%%%%.%%|%%%%%%%%|
|00000850| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000860| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000870| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000880| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00000890| 25 25 25 25 0a 0a 5c 73 | 75 62 73 65 63 74 69 6f |%%%%..\s|ubsectio|
|000008a0| 6e 7b 54 6b 20 63 6f 6d | 6d 61 6e 64 73 7d 0a 0a |n{Tk com|mands}..|
|000008b0| 5c 6c 61 62 65 6c 7b 74 | 6b 63 6f 6d 6d 61 6e 64 |\label{t|kcommand|
|000008c0| 7d 0a 41 73 20 77 65 20 | 6d 65 6e 74 69 6f 6e 65 |}.As we |mentione|
|000008d0| 64 20 69 6e 20 74 68 65 | 20 69 6e 74 72 6f 64 75 |d in the| introdu|
|000008e0| 63 74 69 6f 6e 2c 20 7b | 5c 73 74 6b 7d 20 63 61 |ction, {|\stk} ca|
|000008f0| 6e 20 65 61 73 69 6c 79 | 20 63 6f 6d 6d 75 6e 69 |n easily| communi|
|00000900| 63 61 74 65 0a 77 69 74 | 68 20 74 68 65 20 54 6b |cate.wit|h the Tk|
|00000910| 20 74 6f 6f 6c 6b 69 74 | 5c 69 6e 64 65 78 7b 54 | toolkit|\index{T|
|00000920| 6b 20 74 6f 6f 6c 6b 69 | 74 7d 5c 69 6e 64 65 78 |k toolki|t}\index|
|00000930| 7b 74 6f 6f 6c 6b 69 74 | 7d 2e 20 41 6c 6c 20 74 |{toolkit|}. All t|
|00000940| 68 65 20 63 6f 6d 6d 61 | 6e 64 73 0a 64 65 66 69 |he comma|nds.defi|
|00000950| 6e 65 64 20 62 79 20 74 | 68 65 20 54 6b 20 74 6f |ned by t|he Tk to|
|00000960| 6f 6c 6b 69 74 20 61 72 | 65 20 76 69 73 69 62 6c |olkit ar|e visibl|
|00000970| 65 20 61 73 20 5c 69 64 | 65 7b 54 6b 2d 63 6f 6d |e as \id|e{Tk-com|
|00000980| 6d 61 6e 64 7d 73 2c 20 | 61 20 62 61 73 69 63 0a |mand}s, |a basic.|
|00000990| 74 79 70 65 20 72 65 63 | 6f 67 6e 69 7a 65 64 20 |type rec|ognized |
|000009a0| 62 79 20 74 68 65 20 69 | 6e 74 65 72 70 72 65 74 |by the i|nterpret|
|000009b0| 65 72 2e 20 20 5c 69 64 | 65 7b 54 6b 2d 63 6f 6d |er. \id|e{Tk-com|
|000009c0| 6d 61 6e 64 7d 73 20 63 | 61 6e 20 62 65 20 63 61 |mand}s c|an be ca|
|000009d0| 6c 6c 65 64 0a 6c 69 6b | 65 20 72 65 67 75 6c 61 |lled.lik|e regula|
|000009e0| 72 20 73 63 68 65 6d 65 | 20 70 72 6f 63 65 64 75 |r scheme| procedu|
|000009f0| 72 65 73 2c 20 73 65 72 | 76 69 6e 67 20 61 73 20 |res, ser|ving as |
|00000a00| 61 6e 20 65 6e 74 72 79 | 20 70 6f 69 6e 74 20 69 |an entry| point i|
|00000a10| 6e 74 6f 20 74 68 65 20 | 54 6b 0a 6c 69 62 72 61 |nto the |Tk.libra|
|00000a20| 72 79 2e 0a 25 0a 5c 76 | 73 6b 69 70 33 6d 6d 0a |ry..%.\v|skip3mm.|
|00000a30| 5c 62 65 67 69 6e 7b 6e | 6f 74 65 7d 0a 20 20 53 |\begin{n|ote}. S|
|00000a40| 6f 6d 65 20 5c 69 64 65 | 7b 54 6b 2d 63 6f 6d 6d |ome \ide|{Tk-comm|
|00000a50| 61 6e 64 7d 73 20 63 61 | 6e 20 64 79 6e 61 6d 69 |and}s ca|n dynami|
|00000a60| 63 61 6c 6c 79 20 63 72 | 65 61 74 65 20 6f 74 68 |cally cr|eate oth|
|00000a70| 65 72 0a 20 20 5c 69 64 | 65 7b 54 6b 2d 63 6f 6d |er. \id|e{Tk-com|
|00000a80| 6d 61 6e 64 7d 73 2e 20 | 20 46 6f 72 20 69 6e 73 |mand}s. | For ins|
|00000a90| 74 61 6e 63 65 2c 20 65 | 78 65 63 75 74 69 6f 6e |tance, e|xecution|
|00000aa0| 20 6f 66 20 74 68 65 20 | 65 78 70 72 65 73 73 69 | of the |expressi|
|00000ab0| 6f 6e 0a 20 20 5c 62 65 | 67 69 6e 7b 73 63 68 65 |on. \be|gin{sche|
|00000ac0| 6d 65 7d 0a 28 6c 61 62 | 65 6c 20 27 2e 6c 61 62 |me}.(lab|el '.lab|
|00000ad0| 29 0a 20 20 5c 65 6e 64 | 7b 73 63 68 65 6d 65 7d |). \end|{scheme}|
|00000ae0| 20 25 0a 20 20 77 69 6c | 6c 20 63 72 65 61 74 65 | %. wil|l create|
|00000af0| 20 61 20 6e 65 77 20 5c | 69 64 65 7b 54 6b 2d 63 | a new \|ide{Tk-c|
|00000b00| 6f 6d 6d 61 6e 64 7d 20 | 63 61 6c 6c 65 64 20 60 |ommand} |called `|
|00000b10| 60 5c 76 61 72 7b 2e 6c | 61 62 7d 27 27 2e 20 54 |`\var{.l|ab}''. T|
|00000b20| 68 69 73 20 6e 65 77 0a | 20 20 6f 62 6a 65 63 74 |his new.| object|
|00000b30| 2c 20 77 68 69 63 68 20 | 77 61 73 20 63 72 65 61 |, which |was crea|
|00000b40| 74 65 64 20 62 79 20 61 | 20 70 72 69 6d 69 74 69 |ted by a| primiti|
|00000b50| 76 65 20 5c 69 64 65 7b | 54 6b 2d 63 6f 6d 6d 61 |ve \ide{|Tk-comma|
|00000b60| 6e 64 7d 2c 20 77 69 6c | 6c 20 62 65 0a 20 20 63 |nd}, wil|l be. c|
|00000b70| 61 6c 6c 65 64 20 61 20 | 5c 76 61 72 7b 77 69 64 |alled a |\var{wid|
|00000b80| 67 65 74 7d 5c 69 6e 64 | 65 78 7b 77 69 64 67 65 |get}\ind|ex{widge|
|00000b90| 74 7d 2e 0a 5c 65 6e 64 | 7b 6e 6f 74 65 7d 0a 0a |t}..\end|{note}..|
|00000ba0| 5c 62 65 67 69 6e 7b 6e | 6f 74 65 7d 0a 57 68 65 |\begin{n|ote}.Whe|
|00000bb0| 6e 20 61 20 6e 65 77 20 | 77 69 64 67 65 74 20 69 |n a new |widget i|
|00000bc0| 73 20 63 72 65 61 74 65 | 64 2c 20 69 74 20 63 61 |s create|d, it ca|
|00000bd0| 70 74 75 72 65 73 20 69 | 74 73 20 63 72 65 61 74 |ptures i|ts creat|
|00000be0| 69 6f 6e 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 2e |ion envi|ronment.|
|00000bf0| 20 54 68 69 73 0a 70 65 | 72 6d 69 74 73 20 74 6f | This.pe|rmits to|
|00000c00| 20 68 61 76 65 20 62 69 | 6e 64 69 6e 67 73 20 77 | have bi|ndings w|
|00000c10| 68 69 63 68 20 61 63 63 | 65 73 73 20 76 61 72 69 |hich acc|ess vari|
|00000c20| 61 62 6c 65 73 20 69 6e | 20 74 68 65 20 73 63 6f |ables in| the sco|
|00000c30| 70 65 20 6f 66 20 74 68 | 65 20 77 69 64 67 65 74 |pe of th|e widget|
|00000c40| 0a 63 72 65 61 74 69 6f | 6e 20 63 61 6c 6c 20 28 |.creatio|n call (|
|00000c50| 73 65 65 20 5c 72 65 66 | 7b 61 64 64 72 65 73 73 |see \ref|{address|
|00000c60| 65 73 7d 29 2e 20 20 25 | 25 20 3f 3f 0a 5c 65 6e |es}). %|% ??.\en|
|00000c70| 64 7b 6e 6f 74 65 7d 0a | 0a 5c 62 65 67 69 6e 7b |d{note}.|.\begin{|
|00000c80| 65 6e 74 72 79 7d 7b 25 | 0a 5c 70 72 6f 74 6f 7b |entry}{%|.\proto{|
|00000c90| 74 6b 2d 63 6f 6d 6d 61 | 6e 64 3f 7d 7b 20 6f 62 |tk-comma|nd?}{ ob|
|00000ca0| 6a 7d 7b 70 72 6f 63 65 | 64 75 72 65 7d 7d 0a 5c |j}{proce|dure}}.\|
|00000cb0| 73 61 75 74 0a 52 65 74 | 75 72 6e 73 20 7b 5c 73 |saut.Ret|urns {\s|
|00000cc0| 63 68 74 72 75 65 7d 20 | 69 66 20 5c 76 61 72 7b |chtrue} |if \var{|
|00000cd0| 6f 62 6a 7d 20 69 73 20 | 61 20 5c 69 64 65 7b 54 |obj} is |a \ide{T|
|00000ce0| 6b 2d 63 6f 6d 6d 61 6e | 64 7d 2c 20 6f 74 68 65 |k-comman|d}, othe|
|00000cf0| 72 77 69 73 65 0a 72 65 | 74 75 72 6e 73 20 7b 5c |rwise.re|turns {\|
|00000d00| 73 63 68 66 61 6c 73 65 | 7d 2e 0a 5c 62 65 67 69 |schfalse|}..\begi|
|00000d10| 6e 7b 73 63 68 65 6d 65 | 7d 0a 28 74 6b 2d 63 6f |n{scheme|}.(tk-co|
|00000d20| 6d 6d 61 6e 64 3f 20 6c | 61 62 65 6c 29 20 5c 6c |mmand? l|abel) \l|
|00000d30| 65 76 20 7b 5c 73 63 68 | 74 72 75 65 7d 0a 28 62 |ev {\sch|true}.(b|
|00000d40| 65 67 69 6e 20 28 6c 61 | 62 65 6c 20 27 2e 6c 61 |egin (la|bel '.la|
|00000d50| 62 29 20 28 74 6b 2d 63 | 6f 6d 6d 61 6e 64 3f 20 |b) (tk-c|ommand? |
|00000d60| 2e 6c 61 62 29 29 20 5c | 6c 65 76 20 7b 5c 73 63 |.lab)) \|lev {\sc|
|00000d70| 68 74 72 75 65 7d 0a 28 | 74 6b 2d 63 6f 6d 6d 61 |htrue}.(|tk-comma|
|00000d80| 6e 64 3f 20 31 32 29 20 | 5c 6c 65 76 20 7b 5c 73 |nd? 12) |\lev {\s|
|00000d90| 63 68 66 61 6c 73 65 7d | 0a 5c 65 6e 64 7b 73 63 |chfalse}|.\end{sc|
|00000da0| 68 65 6d 65 7d 0a 5c 65 | 6e 64 7b 65 6e 74 72 79 |heme}.\e|nd{entry|
|00000db0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 65 6e 74 72 79 7d |}..\begi|n{entry}|
|00000dc0| 7b 25 0a 5c 70 72 6f 74 | 6f 7b 77 69 64 67 65 74 |{%.\prot|o{widget|
|00000dd0| 3f 7d 7b 20 6f 62 6a 7d | 7b 70 72 6f 63 65 64 75 |?}{ obj}|{procedu|
|00000de0| 72 65 7d 7d 0a 5c 73 61 | 75 74 0a 52 65 74 75 72 |re}}.\sa|ut.Retur|
|00000df0| 6e 73 20 7b 5c 73 63 68 | 74 72 75 65 7d 20 69 66 |ns {\sch|true} if|
|00000e00| 20 5c 76 61 72 7b 6f 62 | 6a 7d 20 69 73 20 61 20 | \var{ob|j} is a |
|00000e10| 77 69 64 67 65 74 2c 20 | 6f 74 68 65 72 77 69 73 |widget, |otherwis|
|00000e20| 65 20 72 65 74 75 72 6e | 73 0a 7b 5c 73 63 68 66 |e return|s.{\schf|
|00000e30| 61 6c 73 65 7d 2e 20 41 | 20 77 69 64 67 65 74 20 |alse}. A| widget |
|00000e40| 69 73 20 61 20 5c 69 64 | 65 7b 54 6b 2d 63 6f 6d |is a \id|e{Tk-com|
|00000e50| 6d 61 6e 64 7d 20 63 72 | 65 61 74 65 64 20 62 79 |mand} cr|eated by|
|00000e60| 20 61 20 70 72 69 6d 69 | 74 69 76 65 0a 5c 69 64 | a primi|tive.\id|
|00000e70| 65 7b 54 6b 2d 63 6f 6d | 6d 61 6e 64 7d 20 73 75 |e{Tk-com|mand} su|
|00000e80| 63 68 20 61 73 20 5c 69 | 64 65 7b 62 75 74 74 6f |ch as \i|de{butto|
|00000e90| 6e 7d 2c 20 5c 69 64 65 | 7b 6c 61 62 65 6c 7d 2c |n}, \ide|{label},|
|00000ea0| 20 5c 69 64 65 7b 6d 65 | 6e 75 7d 2c 20 65 74 63 | \ide{me|nu}, etc|
|00000eb0| 2e 0a 5c 62 65 67 69 6e | 7b 73 63 68 65 6d 65 7d |..\begin|{scheme}|
|00000ec0| 0a 28 77 69 64 67 65 74 | 3f 20 6c 61 62 65 6c 29 |.(widget|? label)|
|00000ed0| 20 5c 6c 65 76 20 7b 5c | 73 63 68 66 61 6c 73 65 | \lev {\|schfalse|
|00000ee0| 7d 0a 28 62 65 67 69 6e | 20 28 6c 61 62 65 6c 20 |}.(begin| (label |
|00000ef0| 27 2e 6c 61 62 29 20 28 | 77 69 64 67 65 74 3f 20 |'.lab) (|widget? |
|00000f00| 2e 6c 61 62 29 29 20 5c | 6c 65 76 20 7b 5c 73 63 |.lab)) \|lev {\sc|
|00000f10| 68 74 72 75 65 7d 0a 28 | 77 69 64 67 65 74 3f 20 |htrue}.(|widget? |
|00000f20| 31 32 29 20 5c 6c 65 76 | 20 7b 5c 73 63 68 66 61 |12) \lev| {\schfa|
|00000f30| 6c 73 65 7d 0a 5c 65 6e | 64 7b 73 63 68 65 6d 65 |lse}.\en|d{scheme|
|00000f40| 7d 0a 5c 65 6e 64 7b 65 | 6e 74 72 79 7d 0a 0a 5c |}.\end{e|ntry}..\|
|00000f50| 62 65 67 69 6e 7b 65 6e | 74 72 79 7d 7b 25 0a 5c |begin{en|try}{%.\|
|00000f60| 70 72 6f 74 6f 7b 77 69 | 64 67 65 74 2d 3e 73 74 |proto{wi|dget->st|
|00000f70| 72 69 6e 67 7d 7b 20 77 | 69 64 67 65 74 7d 7b 70 |ring}{ w|idget}{p|
|00000f80| 72 6f 63 65 64 75 72 65 | 7d 7d 0a 5c 73 61 75 74 |rocedure|}}.\saut|
|00000f90| 0a 52 65 74 75 72 6e 73 | 20 74 68 65 20 77 69 64 |.Returns| the wid|
|00000fa0| 67 65 74 20 6e 61 6d 65 | 20 6f 66 20 5c 76 61 72 |get name| of \var|
|00000fb0| 7b 77 69 64 67 65 74 7d | 20 61 73 20 61 20 73 74 |{widget}| as a st|
|00000fc0| 72 69 6e 67 2e 0a 5c 62 | 65 67 69 6e 7b 73 63 68 |ring..\b|egin{sch|
|00000fd0| 65 6d 65 7d 0a 28 62 65 | 67 69 6e 20 28 6c 61 62 |eme}.(be|gin (lab|
|00000fe0| 65 6c 20 27 2e 6c 61 62 | 29 20 28 77 69 64 67 65 |el '.lab|) (widge|
|00000ff0| 74 2d 3e 73 74 72 69 6e | 67 20 2e 6c 61 62 29 29 |t->strin|g .lab))|
|00001000| 20 5c 6c 65 76 20 22 2e | 6c 61 62 22 0a 5c 65 6e | \lev ".|lab".\en|
|00001010| 64 7b 73 63 68 65 6d 65 | 7d 0a 5c 65 6e 64 7b 65 |d{scheme|}.\end{e|
|00001020| 6e 74 72 79 7d 0a 0a 5c | 62 65 67 69 6e 7b 65 6e |ntry}..\|begin{en|
|00001030| 74 72 79 7d 7b 25 0a 5c | 70 72 6f 74 6f 7b 73 74 |try}{%.\|proto{st|
|00001040| 72 69 6e 67 2d 3e 77 69 | 64 67 65 74 7d 7b 20 73 |ring->wi|dget}{ s|
|00001050| 74 72 7d 7b 70 72 6f 63 | 65 64 75 72 65 7d 7d 0a |tr}{proc|edure}}.|
|00001060| 5c 73 61 75 74 0a 52 65 | 74 75 72 6e 73 20 74 68 |\saut.Re|turns th|
|00001070| 65 20 77 69 64 67 65 74 | 20 77 68 6f 73 65 20 6e |e widget| whose n|
|00001080| 61 6d 65 20 69 73 20 5c | 76 61 72 7b 73 74 72 7d |ame is \|var{str}|
|00001090| 20 69 66 20 69 74 20 65 | 78 69 73 74 73 3b 20 6f | if it e|xists; o|
|000010a0| 74 68 65 72 77 69 73 65 | 0a 72 65 74 75 72 6e 73 |therwise|.returns|
|000010b0| 20 7b 5c 73 63 68 66 61 | 6c 73 65 7d 2e 0a 5c 62 | {\schfa|lse}..\b|
|000010c0| 65 67 69 6e 7b 73 63 68 | 65 6d 65 7d 0a 28 62 65 |egin{sch|eme}.(be|
|000010d0| 67 69 6e 20 28 6c 61 62 | 65 6c 20 27 2e 6c 61 62 |gin (lab|el '.lab|
|000010e0| 29 20 28 73 74 72 69 6e | 67 2d 3e 77 69 64 67 65 |) (strin|g->widge|
|000010f0| 74 20 22 2e 6c 61 62 22 | 29 29 20 5c 6c 65 76 20 |t ".lab"|)) \lev |
|00001100| 74 68 65 20 5c 69 64 65 | 7b 54 6b 2d 63 6f 6d 6d |the \ide|{Tk-comm|
|00001110| 61 6e 64 7d 20 6e 61 6d | 65 64 20 22 2e 6c 61 62 |and} nam|ed ".lab|
|00001120| 22 0a 5c 65 6e 64 7b 73 | 63 68 65 6d 65 7d 0a 5c |".\end{s|cheme}.\|
|00001130| 65 6e 64 7b 65 6e 74 72 | 79 7d 0a 0a 5c 62 65 67 |end{entr|y}..\beg|
|00001140| 69 6e 7b 65 6e 74 72 79 | 7d 7b 25 0a 5c 70 72 6f |in{entry|}{%.\pro|
|00001150| 74 6f 7b 77 69 64 67 65 | 74 2d 6e 61 6d 65 7d 7b |to{widge|t-name}{|
|00001160| 20 77 69 64 67 65 74 7d | 7b 70 72 6f 63 65 64 75 | widget}|{procedu|
|00001170| 72 65 7d 7d 0a 5c 73 61 | 75 74 0a 52 65 74 75 72 |re}}.\sa|ut.Retur|
|00001180| 6e 73 20 74 68 65 20 77 | 69 64 67 65 74 20 6e 61 |ns the w|idget na|
|00001190| 6d 65 20 6f 66 20 5c 76 | 61 72 7b 77 69 64 67 65 |me of \v|ar{widge|
|000011a0| 74 7d 20 61 73 20 61 20 | 73 79 6d 62 6f 6c 2e 20 |t} as a |symbol. |
|000011b0| 0a 5c 62 65 67 69 6e 7b | 73 63 68 65 6d 65 7d 0a |.\begin{|scheme}.|
|000011c0| 28 62 65 67 69 6e 20 28 | 6c 61 62 65 6c 20 27 2e |(begin (|label '.|
|000011d0| 6c 61 62 29 20 28 77 69 | 64 67 65 74 2d 3e 6e 61 |lab) (wi|dget->na|
|000011e0| 6d 65 20 2e 6c 61 62 29 | 29 20 5c 6c 65 76 20 2e |me .lab)|) \lev .|
|000011f0| 6c 61 62 0a 5c 65 6e 64 | 7b 73 63 68 65 6d 65 7d |lab.\end|{scheme}|
|00001200| 0a 5c 65 6e 64 7b 65 6e | 74 72 79 7d 0a 0a 5c 62 |.\end{en|try}..\b|
|00001210| 65 67 69 6e 7b 65 6e 74 | 72 79 7d 7b 0a 5c 70 72 |egin{ent|ry}{.\pr|
|00001220| 6f 74 6f 7b 73 65 74 2d | 77 69 64 67 65 74 2d 64 |oto{set-|widget-d|
|00001230| 61 74 61 21 7d 7b 20 77 | 69 64 67 65 74 20 65 78 |ata!}{ w|idget ex|
|00001240| 70 72 7d 7b 70 72 6f 63 | 65 64 75 72 65 7d 7d 0a |pr}{proc|edure}}.|
|00001250| 5c 73 61 75 74 0a 25 0a | 5c 69 64 65 7b 53 65 74 |\saut.%.|\ide{Set|
|00001260| 2d 77 69 64 67 65 74 2d | 64 61 74 61 21 7d 20 61 |-widget-|data!} a|
|00001270| 73 73 6f 63 69 61 74 65 | 73 20 61 72 62 69 74 72 |ssociate|s arbitr|
|00001280| 61 72 79 20 64 61 74 61 | 20 77 69 74 68 20 61 20 |ary data| with a |
|00001290| 5c 76 61 72 7b 77 69 64 | 67 65 74 7d 2e 0a 54 68 |\var{wid|get}..Th|
|000012a0| 65 20 73 79 73 74 65 6d | 20 6d 61 6b 65 73 20 6e |e system| makes n|
|000012b0| 6f 20 61 73 73 75 6d 70 | 74 69 6f 6e 73 20 61 62 |o assump|tions ab|
|000012c0| 6f 75 74 20 74 68 65 20 | 74 79 70 65 20 6f 66 20 |out the |type of |
|000012d0| 7b 5c 74 74 20 65 78 70 | 72 7d 3b 20 74 68 65 20 |{\tt exp|r}; the |
|000012e0| 64 61 74 61 0a 69 73 20 | 66 6f 72 20 70 72 6f 67 |data.is |for prog|
|000012f0| 72 61 6d 6d 65 72 20 63 | 6f 6e 76 65 6e 69 65 6e |rammer c|onvenien|
|00001300| 63 65 20 6f 6e 6c 79 2e | 20 41 73 20 73 68 6f 77 |ce only.| As show|
|00001310| 6e 20 62 65 6c 6f 77 2c | 20 69 74 20 63 6f 75 6c |n below,| it coul|
|00001320| 64 20 62 65 20 75 73 65 | 64 0a 61 73 20 61 20 6b |d be use|d.as a k|
|00001330| 69 6e 64 20 6f 66 20 70 | 72 6f 70 65 72 74 79 20 |ind of p|roperty |
|00001340| 6c 69 73 74 20 66 6f 72 | 20 77 69 64 67 65 74 73 |list for| widgets|
|00001350| 2e 0a 5c 65 6e 64 7b 65 | 6e 74 72 79 7d 0a 0a 5c |..\end{e|ntry}..\|
|00001360| 62 65 67 69 6e 7b 65 6e | 74 72 79 7d 7b 0a 5c 70 |begin{en|try}{.\p|
|00001370| 72 6f 74 6f 7b 67 65 74 | 2d 77 69 64 67 65 74 2d |roto{get|-widget-|
|00001380| 64 61 74 61 7d 7b 20 77 | 69 64 67 65 74 7d 7b 70 |data}{ w|idget}{p|
|00001390| 72 6f 63 65 64 75 72 65 | 7d 7d 0a 5c 73 61 75 74 |rocedure|}}.\saut|
|000013a0| 0a 52 65 74 75 72 6e 73 | 20 74 68 65 20 64 61 74 |.Returns| the dat|
|000013b0| 61 20 70 72 65 76 69 6f | 75 73 6c 79 20 61 73 73 |a previo|usly ass|
|000013c0| 6f 63 69 61 74 65 64 20 | 77 69 74 68 20 5c 76 61 |ociated |with \va|
|000013d0| 72 7b 77 69 64 67 65 74 | 7d 20 69 66 20 69 74 20 |r{widget|} if it |
|000013e0| 65 78 69 73 74 73 3b 0a | 6f 74 68 65 72 77 69 73 |exists;.|otherwis|
|000013f0| 65 20 72 65 74 75 72 6e | 73 20 7b 5c 73 63 68 66 |e return|s {\schf|
|00001400| 61 6c 73 65 7d 2e 0a 5c | 62 65 67 69 6e 7b 73 63 |alse}..\|begin{sc|
|00001410| 68 65 6d 65 7d 0a 28 62 | 65 67 69 6e 20 0a 20 20 |heme}.(b|egin . |
|00001420| 20 28 73 65 74 2d 77 69 | 64 67 65 74 2d 64 61 74 | (set-wi|dget-dat|
|00001430| 61 21 20 2e 77 20 27 28 | 3a 6d 61 70 70 65 64 20 |a! .w '(|:mapped |
|00001440| 7b 5c 73 63 68 74 72 75 | 65 7d 20 3a 67 65 6f 6d |{\schtru|e} :geom|
|00001450| 65 74 72 79 20 22 31 30 | 78 35 30 22 29 29 0a 20 |etry "10|x50")). |
|00001460| 20 20 28 67 65 74 2d 6b | 65 79 77 6f 72 64 20 3a | (get-k|eyword :|
|00001470| 6d 61 70 70 65 64 20 28 | 67 65 74 2d 77 69 64 67 |mapped (|get-widg|
|00001480| 65 74 2d 64 61 74 61 20 | 2e 77 29 29 29 20 5c 6c |et-data |.w))) \l|
|00001490| 65 76 20 7b 5c 73 63 68 | 74 72 75 65 7d 0a 5c 65 |ev {\sch|true}.\e|
|000014a0| 6e 64 7b 73 63 68 65 6d | 65 7d 0a 5c 65 6e 64 7b |nd{schem|e}.\end{|
|000014b0| 65 6e 74 72 79 7d 0a 0a | 0a 25 25 25 25 25 25 25 |entry}..|.%%%%%%%|
|000014c0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000014d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000014e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000014f0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001500| 25 25 25 25 25 25 25 0a | 25 25 25 25 0a 25 25 25 |%%%%%%%.|%%%%.%%%|
|00001510| 25 20 53 65 63 74 69 6f | 6e 20 36 2e 31 33 3a 20 |% Sectio|n 6.13: |
|00001520| 20 45 6e 76 69 72 6f 6e | 6d 65 6e 74 73 0a 25 25 | Environ|ments.%%|
|00001530| 25 25 0a 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%.%%%%%|%%%%%%%%|
|00001540| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001550| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001560| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001570| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001580| 25 0a 0a 5c 73 75 62 73 | 65 63 74 69 6f 6e 7b 45 |%..\subs|ection{E|
|00001590| 6e 76 69 72 6f 6e 6d 65 | 6e 74 73 7d 0a 0a 5c 6c |nvironme|nts}..\l|
|000015a0| 61 62 65 6c 7b 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |abel{env|ironment|
|000015b0| 7d 0a 45 6e 76 69 72 6f | 6e 6d 65 6e 74 73 20 61 |}.Enviro|nments a|
|000015c0| 72 65 20 66 69 72 73 74 | 20 63 6c 61 73 73 20 6f |re first| class o|
|000015d0| 62 6a 65 63 74 73 20 69 | 6e 20 53 54 6b 2e 20 54 |bjects i|n STk. T|
|000015e0| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 70 72 69 |he follo|wing pri|
|000015f0| 6d 69 74 69 76 65 73 0a | 61 72 65 20 64 65 66 69 |mitives.|are defi|
|00001600| 6e 65 64 20 6f 6e 20 65 | 6e 76 69 72 6f 6e 6d 65 |ned on e|nvironme|
|00001610| 6e 74 73 2e 0a 0a 5c 62 | 65 67 69 6e 7b 65 6e 74 |nts...\b|egin{ent|
|00001620| 72 79 7d 7b 25 0a 5c 70 | 72 6f 74 6f 7b 65 6e 76 |ry}{%.\p|roto{env|
|00001630| 69 72 6f 6e 6d 65 6e 74 | 3f 7d 7b 20 6f 62 6a 7d |ironment|?}{ obj}|
|00001640| 20 7b 70 72 6f 63 65 64 | 75 72 65 7d 7d 0a 5c 73 | {proced|ure}}.\s|
|00001650| 61 75 74 0a 52 65 74 75 | 72 6e 73 20 7b 5c 73 63 |aut.Retu|rns {\sc|
|00001660| 68 74 72 75 65 7d 20 69 | 66 20 5c 76 61 72 7b 6f |htrue} i|f \var{o|
|00001670| 62 6a 7d 20 69 73 20 61 | 6e 20 65 6e 76 69 72 6f |bj} is a|n enviro|
|00001680| 6e 6d 65 6e 74 2c 20 6f | 74 68 65 72 77 69 73 65 |nment, o|therwise|
|00001690| 20 72 65 74 75 72 6e 73 | 0a 7b 5c 73 63 68 66 61 | returns|.{\schfa|
|000016a0| 6c 73 65 7d 2e 0a 5c 65 | 6e 64 7b 65 6e 74 72 79 |lse}..\e|nd{entry|
|000016b0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 65 6e 74 72 79 7d |}..\begi|n{entry}|
|000016c0| 7b 25 0a 5c 70 72 6f 74 | 6f 7b 74 68 65 2d 65 6e |{%.\prot|o{the-en|
|000016d0| 76 69 72 6f 6e 6d 65 6e | 74 7d 20 7b 7d 20 7b 70 |vironmen|t} {} {p|
|000016e0| 72 6f 63 65 64 75 72 65 | 7d 7d 0a 5c 73 61 75 74 |rocedure|}}.\saut|
|000016f0| 0a 52 65 74 75 72 6e 73 | 20 74 68 65 20 63 75 72 |.Returns| the cur|
|00001700| 72 65 6e 74 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |rent env|ironment|
|00001710| 2e 0a 5c 65 6e 64 7b 65 | 6e 74 72 79 7d 0a 0a 5c |..\end{e|ntry}..\|
|00001720| 62 65 67 69 6e 7b 65 6e | 74 72 79 7d 7b 25 0a 5c |begin{en|try}{%.\|
|00001730| 70 72 6f 74 6f 7b 67 6c | 6f 62 61 6c 2d 65 6e 76 |proto{gl|obal-env|
|00001740| 69 72 6f 6e 6d 65 6e 74 | 7d 20 7b 7d 20 7b 70 72 |ironment|} {} {pr|
|00001750| 6f 63 65 64 75 72 65 7d | 7d 0a 5c 73 61 75 74 0a |ocedure}|}.\saut.|
|00001760| 52 65 74 75 72 6e 73 20 | 74 68 65 20 60 60 67 6c |Returns |the ``gl|
|00001770| 6f 62 61 6c 27 27 20 65 | 6e 76 69 72 6f 6e 6d 65 |obal'' e|nvironme|
|00001780| 6e 74 20 28 69 2e 65 2e | 20 74 68 65 20 74 6f 70 |nt (i.e.| the top|
|00001790| 6c 65 76 65 6c 20 65 6e | 76 69 72 6f 6e 6d 65 6e |level en|vironmen|
|000017a0| 74 29 2e 0a 5c 6d 61 69 | 6e 69 6e 64 65 78 7b 74 |t)..\mai|nindex{t|
|000017b0| 6f 70 20 6c 65 76 65 6c | 20 65 6e 76 69 72 6f 6e |op level| environ|
|000017c0| 6d 65 6e 74 7d 0a 5c 65 | 6e 64 7b 65 6e 74 72 79 |ment}.\e|nd{entry|
|000017d0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 65 6e 74 72 79 7d |}..\begi|n{entry}|
|000017e0| 7b 25 0a 5c 70 72 6f 74 | 6f 7b 70 61 72 65 6e 74 |{%.\prot|o{parent|
|000017f0| 2d 65 6e 76 69 72 6f 6e | 6d 65 6e 74 7d 20 7b 20 |-environ|ment} { |
|00001800| 65 6e 76 7d 20 7b 70 72 | 6f 63 65 64 75 72 65 7d |env} {pr|ocedure}|
|00001810| 7d 0a 5c 73 61 75 74 0a | 52 65 74 75 72 6e 73 20 |}.\saut.|Returns |
|00001820| 74 68 65 20 70 61 72 65 | 6e 74 20 65 6e 76 69 72 |the pare|nt envir|
|00001830| 6f 6e 6d 65 6e 74 20 6f | 66 20 5c 76 61 72 7b 65 |onment o|f \var{e|
|00001840| 6e 76 7d 2e 20 49 66 20 | 65 6e 76 20 69 73 20 74 |nv}. If |env is t|
|00001850| 68 65 20 60 60 67 6c 6f | 62 61 6c 27 27 0a 65 6e |he ``glo|bal''.en|
|00001860| 76 69 72 6f 6e 6d 65 6e | 74 20 28 69 2e 65 2e 20 |vironmen|t (i.e. |
|00001870| 74 68 65 20 74 6f 70 6c | 65 76 65 6c 20 65 6e 76 |the topl|evel env|
|00001880| 69 72 6f 6e 6d 65 6e 74 | 29 2c 20 5c 69 64 65 7b |ironment|), \ide{|
|00001890| 70 61 72 65 6e 74 2d 65 | 6e 76 69 72 6f 6e 6d 65 |parent-e|nvironme|
|000018a0| 6e 74 7d 0a 72 65 74 75 | 72 6e 73 20 7b 5c 73 63 |nt}.retu|rns {\sc|
|000018b0| 68 66 61 6c 73 65 7d 2e | 0a 5c 65 6e 64 7b 65 6e |hfalse}.|.\end{en|
|000018c0| 74 72 79 7d 0a 0a 5c 62 | 65 67 69 6e 7b 65 6e 74 |try}..\b|egin{ent|
|000018d0| 72 79 7d 7b 25 0a 5c 70 | 72 6f 74 6f 7b 65 6e 76 |ry}{%.\p|roto{env|
|000018e0| 69 72 6f 6e 6d 65 6e 74 | 2d 3e 6c 69 73 74 7d 7b |ironment|->list}{|
|000018f0| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 7d 20 7b 70 | environ|ment} {p|
|00001900| 72 6f 63 65 64 75 72 65 | 7d 7d 0a 5c 73 61 75 74 |rocedure|}}.\saut|
|00001910| 0a 52 65 74 75 72 6e 73 | 20 61 20 6c 69 73 74 20 |.Returns| a list |
|00001920| 6f 66 20 7b 5c 65 6d 20 | 61 2d 6c 69 73 74 73 7d |of {\em |a-lists}|
|00001930| 2c 20 72 65 70 72 65 73 | 65 6e 74 69 6e 67 20 74 |, repres|enting t|
|00001940| 68 65 20 62 69 6e 64 69 | 6e 67 73 20 69 6e 0a 5c |he bindi|ngs in.\|
|00001950| 76 61 72 7b 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 7d |var{envi|ronment}|
|00001960| 2e 20 45 61 63 68 20 7b | 5c 65 6d 20 61 2d 6c 69 |. Each {|\em a-li|
|00001970| 73 74 7d 20 64 65 73 63 | 72 69 62 65 73 20 6f 6e |st} desc|ribes on|
|00001980| 65 20 6c 65 76 65 6c 20 | 6f 66 20 62 69 6e 64 69 |e level |of bindi|
|00001990| 6e 67 73 2c 0a 77 69 74 | 68 20 74 68 65 20 69 6e |ngs,.wit|h the in|
|000019a0| 6e 65 72 6d 6f 73 74 20 | 6c 65 76 65 6c 20 63 6f |nermost |level co|
|000019b0| 6d 69 6e 67 20 66 69 72 | 73 74 2e 0a 5c 62 65 67 |ming fir|st..\beg|
|000019c0| 69 6e 7b 73 63 68 65 6d | 65 7d 0a 28 64 65 66 69 |in{schem|e}.(defi|
|000019d0| 6e 65 20 45 20 28 6c 65 | 74 20 28 28 61 20 31 29 |ne E (le|t ((a 1)|
|000019e0| 20 28 62 20 32 29 29 0a | 20 20 20 20 20 20 20 20 | (b 2)).| |
|000019f0| 20 20 20 20 28 6c 65 74 | 20 28 28 63 20 33 29 29 | (let| ((c 3))|
|00001a00| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 28 |. | (|
|00001a10| 74 68 65 2d 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 29 |the-envi|ronment)|
|00001a20| 29 29 29 0a 0a 28 63 61 | 72 20 28 65 6e 76 69 72 |)))..(ca|r (envir|
|00001a30| 6f 6e 6d 65 6e 74 2d 3e | 6c 69 73 74 20 45 29 29 |onment->|list E))|
|00001a40| 20 5c 65 76 20 28 28 63 | 20 2e 20 33 29 29 0a 0a | \ev ((c| . 3))..|
|00001a50| 28 63 61 64 72 20 28 65 | 6e 76 69 72 6f 6e 6d 65 |(cadr (e|nvironme|
|00001a60| 6e 74 2d 3e 6c 69 73 74 | 20 45 29 29 20 5c 65 76 |nt->list| E)) \ev|
|00001a70| 20 28 28 62 20 2e 20 32 | 29 20 28 61 20 2e 20 31 | ((b . 2|) (a . 1|
|00001a80| 29 29 0a 5c 65 6e 64 7b | 73 63 68 65 6d 65 7d 0a |)).\end{|scheme}.|
|00001a90| 5c 65 6e 64 7b 65 6e 74 | 72 79 7d 0a 0a 5c 62 65 |\end{ent|ry}..\be|
|00001aa0| 67 69 6e 7b 65 6e 74 72 | 79 7d 7b 25 0a 5c 70 72 |gin{entr|y}{%.\pr|
|00001ab0| 6f 74 6f 7b 70 72 6f 63 | 65 64 75 72 65 2d 65 6e |oto{proc|edure-en|
|00001ac0| 76 69 72 6f 6e 6d 65 6e | 74 7d 7b 20 70 72 6f 63 |vironmen|t}{ proc|
|00001ad0| 65 64 75 72 65 7d 20 7b | 70 72 6f 63 65 64 75 72 |edure} {|procedur|
|00001ae0| 65 7d 7d 0a 5c 73 61 75 | 74 0a 52 65 74 75 72 6e |e}}.\sau|t.Return|
|00001af0| 73 20 74 68 65 20 65 6e | 76 69 72 6f 6e 6d 65 6e |s the en|vironmen|
|00001b00| 74 20 61 73 73 6f 63 69 | 61 74 65 64 20 77 69 74 |t associ|ated wit|
|00001b10| 68 20 5c 76 61 72 7b 70 | 72 6f 63 65 64 75 72 65 |h \var{p|rocedure|
|00001b20| 7d 2e 0a 5c 69 64 65 7b | 50 72 6f 63 65 64 75 72 |}..\ide{|Procedur|
|00001b30| 65 2d 65 6e 76 69 72 6f | 6e 6d 65 6e 74 7d 20 72 |e-enviro|nment} r|
|00001b40| 65 74 75 72 6e 73 20 7b | 5c 73 63 68 66 61 6c 73 |eturns {|\schfals|
|00001b50| 65 7d 20 69 66 20 5c 76 | 61 72 7b 70 72 6f 63 65 |e} if \v|ar{proce|
|00001b60| 64 75 72 65 7d 0a 69 73 | 20 6e 6f 74 20 61 20 63 |dure}.is| not a c|
|00001b70| 6c 6f 73 75 72 65 2e 0a | 5c 62 65 67 69 6e 7b 73 |losure..|\begin{s|
|00001b80| 63 68 65 6d 65 7d 0a 28 | 64 65 66 69 6e 65 20 66 |cheme}.(|define f|
|00001b90| 6f 6f 20 28 6c 65 74 20 | 28 28 61 20 31 29 29 20 |oo (let |((a 1)) |
|00001ba0| 28 6c 61 6d 62 64 61 20 | 28 29 20 61 29 29 29 0a |(lambda |() a))).|
|00001bb0| 28 63 61 72 20 28 65 6e | 76 69 72 6f 6e 6d 65 6e |(car (en|vironmen|
|00001bc0| 74 2d 3e 6c 69 73 74 20 | 0a 20 20 20 20 20 20 20 |t->list |. |
|00001bd0| 20 20 28 70 72 6f 63 65 | 64 75 72 65 2d 65 6e 76 | (proce|dure-env|
|00001be0| 69 72 6f 6e 6d 65 6e 74 | 20 66 6f 6f 29 29 29 20 |ironment| foo))) |
|00001bf0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00001c00| 20 20 20 20 20 20 20 5c | 65 76 20 28 28 61 20 2e | \|ev ((a .|
|00001c10| 20 31 29 29 0a 5c 65 6e | 64 7b 73 63 68 65 6d 65 | 1)).\en|d{scheme|
|00001c20| 7d 0a 5c 65 6e 64 7b 65 | 6e 74 72 79 7d 0a 0a 5c |}.\end{e|ntry}..\|
|00001c30| 62 65 67 69 6e 7b 65 6e | 74 72 79 7d 7b 25 0a 5c |begin{en|try}{%.\|
|00001c40| 70 72 6f 74 6f 7b 73 79 | 6d 62 6f 6c 2d 62 6f 75 |proto{sy|mbol-bou|
|00001c50| 6e 64 3f 7d 7b 20 73 79 | 6d 62 6f 6c 7d 7b 70 72 |nd?}{ sy|mbol}{pr|
|00001c60| 6f 63 65 64 75 72 65 7d | 0a 5c 70 72 6f 74 6f 7b |ocedure}|.\proto{|
|00001c70| 73 79 6d 62 6f 6c 2d 62 | 6f 75 6e 64 3f 7d 7b 20 |symbol-b|ound?}{ |
|00001c80| 73 79 6d 62 6f 6c 20 65 | 6e 76 69 72 6f 6e 6d 65 |symbol e|nvironme|
|00001c90| 6e 74 7d 7b 70 72 6f 63 | 65 64 75 72 65 7d 7d 0a |nt}{proc|edure}}.|
|00001ca0| 5c 73 61 75 74 0a 52 65 | 74 75 72 6e 73 20 7b 5c |\saut.Re|turns {\|
|00001cb0| 73 63 68 74 72 75 65 7d | 20 69 66 20 5c 76 61 72 |schtrue}| if \var|
|00001cc0| 7b 73 79 6d 62 6f 6c 7d | 20 68 61 73 20 61 20 76 |{symbol}| has a v|
|00001cd0| 61 6c 75 65 20 69 6e 20 | 74 68 65 20 67 69 76 65 |alue in |the give|
|00001ce0| 6e 0a 5c 76 61 72 7b 65 | 6e 76 69 72 6f 6e 6d 65 |n.\var{e|nvironme|
|00001cf0| 6e 74 7d 2c 20 6f 74 68 | 65 72 77 69 73 65 20 72 |nt}, oth|erwise r|
|00001d00| 65 74 75 72 6e 73 20 7b | 5c 73 63 68 66 61 6c 73 |eturns {|\schfals|
|00001d10| 65 7d 2e 20 5c 76 61 72 | 7b 45 6e 76 69 72 6f 6e |e}. \var|{Environ|
|00001d20| 6d 65 6e 74 7d 0a 6d 61 | 79 20 62 65 20 6f 6d 69 |ment}.ma|y be omi|
|00001d30| 74 74 65 64 2c 20 69 6e | 20 77 68 69 63 68 20 63 |tted, in| which c|
|00001d40| 61 73 65 20 69 74 20 64 | 65 66 61 75 6c 74 73 20 |ase it d|efaults |
|00001d50| 74 6f 20 74 68 65 20 67 | 6c 6f 62 61 6c 20 65 6e |to the g|lobal en|
|00001d60| 76 69 72 6f 6e 6d 65 6e | 74 2e 0a 5c 65 6e 64 7b |vironmen|t..\end{|
|00001d70| 65 6e 74 72 79 7d 0a 0a | 25 25 25 25 25 25 25 25 |entry}..|%%%%%%%%|
|00001d80| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001d90| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001da0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001db0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001dc0| 25 25 25 25 25 25 0a 25 | 25 25 25 0a 25 25 25 25 |%%%%%%.%|%%%.%%%%|
|00001dd0| 20 53 65 63 74 69 6f 6e | 20 36 2e 31 34 3a 20 4d | Section| 6.14: M|
|00001de0| 61 63 72 6f 73 0a 25 25 | 25 25 0a 25 25 25 25 25 |acros.%%|%%.%%%%%|
|00001df0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001e00| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001e10| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001e20| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00001e30| 25 25 25 25 25 25 25 25 | 25 0a 0a 5c 73 75 62 73 |%%%%%%%%|%..\subs|
|00001e40| 65 63 74 69 6f 6e 7b 4d | 61 63 72 6f 73 7d 0a 5c |ection{M|acros}.\|
|00001e50| 6c 61 62 65 6c 7b 6d 61 | 63 72 6f 73 7d 0a 0a 7b |label{ma|cros}..{|
|00001e60| 5c 73 74 6b 7d 20 70 72 | 6f 76 69 64 65 73 20 6c |\stk} pr|ovides l|
|00001e70| 6f 77 20 6c 65 76 65 6c | 20 6d 61 63 72 6f 73 2e |ow level| macros.|
|00001e80| 20 0a 0a 5c 62 65 67 69 | 6e 7b 6e 6f 74 65 7d 0a | ..\begi|n{note}.|
|00001e90| 7b 5c 73 74 6b 7d 20 6d | 61 63 72 6f 73 20 61 72 |{\stk} m|acros ar|
|00001ea0| 65 20 6e 6f 74 20 74 68 | 65 20 73 6f 72 74 20 6f |e not th|e sort o|
|00001eb0| 66 20 6d 61 63 72 6f 73 | 20 64 65 66 69 6e 65 64 |f macros| defined|
|00001ec0| 20 69 6e 20 74 68 65 20 | 61 70 70 65 6e 64 69 78 | in the |appendix|
|00001ed0| 20 6f 66 20 7b 5c 72 72 | 72 72 7d 2c 0a 62 75 74 | of {\rr|rr},.but|
|00001ee0| 20 72 61 74 68 65 72 20 | 74 68 65 20 6d 61 63 72 | rather |the macr|
|00001ef0| 6f 73 20 6f 6e 65 20 63 | 61 6e 20 66 69 6e 64 20 |os one c|an find |
|00001f00| 69 6e 20 6d 6f 73 74 20 | 6f 66 20 4c 69 73 70 20 |in most |of Lisp |
|00001f10| 64 69 61 6c 65 63 74 73 | 2e 0a 5c 65 6e 64 7b 6e |dialects|..\end{n|
|00001f20| 6f 74 65 7d 0a 0a 5c 62 | 65 67 69 6e 7b 65 6e 74 |ote}..\b|egin{ent|
|00001f30| 72 79 7d 7b 25 0a 5c 70 | 72 6f 74 6f 7b 6d 61 63 |ry}{%.\p|roto{mac|
|00001f40| 72 6f 7d 7b 20 5c 68 79 | 70 65 72 7b 66 6f 72 6d |ro}{ \hy|per{form|
|00001f50| 61 6c 73 7d 20 5c 68 79 | 70 65 72 7b 62 6f 64 79 |als} \hy|per{body|
|00001f60| 7d 7d 7b 5c 65 78 70 72 | 74 79 70 65 7d 7d 0a 5c |}}{\expr|type}}.\|
|00001f70| 73 61 75 74 0a 7b 5c 74 | 74 20 4d 61 63 72 6f 7d |saut.{\t|t Macro}|
|00001f80| 20 70 65 72 6d 69 74 73 | 20 74 6f 20 63 72 65 61 | permits| to crea|
|00001f90| 74 65 20 61 20 6d 61 63 | 72 6f 2e 20 57 68 65 6e |te a mac|ro. When|
|00001fa0| 20 61 20 6d 61 63 72 6f | 20 69 73 20 63 61 6c 6c | a macro| is call|
|00001fb0| 65 64 2c 20 74 68 65 20 | 77 68 6f 6c 65 20 66 6f |ed, the |whole fo|
|00001fc0| 72 6d 0a 28 69 2e 65 2e | 20 74 68 65 20 6d 61 63 |rm.(i.e.| the mac|
|00001fd0| 72 6f 20 69 74 73 65 6c | 66 20 61 6e 64 20 69 74 |ro itsel|f and it|
|00001fe0| 73 20 70 61 72 61 6d 65 | 74 65 72 73 29 20 69 73 |s parame|ters) is|
|00001ff0| 20 70 61 73 73 65 64 20 | 74 6f 20 74 68 65 20 6d | passed |to the m|
|00002000| 61 63 72 6f 20 62 6f 64 | 79 2e 0a 42 69 6e 64 69 |acro bod|y..Bindi|
|00002010| 6e 67 20 61 73 73 6f 63 | 69 61 74 69 6f 6e 20 69 |ng assoc|iation i|
|00002020| 73 20 64 6f 6e 65 20 69 | 6e 20 74 68 65 20 65 6e |s done i|n the en|
|00002030| 76 69 72 6f 6e 6d 65 6e | 74 20 6f 66 20 74 68 65 |vironmen|t of the|
|00002040| 20 63 61 6c 6c 2e 20 54 | 68 65 20 72 65 73 75 6c | call. T|he resul|
|00002050| 74 20 6f 66 20 74 68 65 | 0a 62 69 6e 64 69 6e 67 |t of the|.binding|
|00002060| 20 61 73 73 6f 63 69 61 | 74 69 6f 6e 20 69 73 20 | associa|tion is |
|00002070| 63 61 6c 6c 65 64 20 74 | 68 65 20 7b 5c 65 6d 20 |called t|he {\em |
|00002080| 6d 61 63 72 6f 2d 65 78 | 70 61 6e 73 69 6f 6e 7d |macro-ex|pansion}|
|00002090| 5c 69 6e 64 65 78 7b 6d | 61 63 72 6f 2d 65 78 70 |\index{m|acro-exp|
|000020a0| 61 6e 73 69 6f 6e 7d 2e | 0a 54 68 65 20 72 65 73 |ansion}.|.The res|
|000020b0| 75 6c 74 20 6f 66 20 74 | 68 65 20 6d 61 63 72 6f |ult of t|he macro|
|000020c0| 20 63 61 6c 6c 20 69 73 | 20 74 68 65 20 72 65 73 | call is| the res|
|000020d0| 75 6c 74 20 6f 66 20 74 | 68 65 20 65 76 61 6c 75 |ult of t|he evalu|
|000020e0| 61 74 69 6f 6e 20 6f 66 | 20 74 68 65 0a 6d 61 63 |ation of| the.mac|
|000020f0| 72 6f 20 65 78 70 61 6e | 73 69 6f 6e 20 69 6e 20 |ro expan|sion in |
|00002100| 74 68 65 20 63 61 6c 6c | 20 65 6e 76 69 72 6f 6e |the call| environ|
|00002110| 6d 65 6e 74 2e 0a 25 25 | 20 46 49 58 4d 45 3a 20 |ment..%%| FIXME: |
|00002120| 54 68 69 73 20 6e 65 65 | 64 73 20 72 65 70 68 72 |This nee|ds rephr|
|00002130| 61 73 69 6e 67 2e 2e 2e | 0a 0a 5c 62 65 67 69 6e |asing...|..\begin|
|00002140| 7b 73 63 68 65 6d 65 7d | 0a 28 64 65 66 69 6e 65 |{scheme}|.(define|
|00002150| 20 66 6f 6f 20 28 6d 61 | 63 72 6f 20 66 20 60 28 | foo (ma|cro f `(|
|00002160| 71 75 6f 74 65 20 2c 66 | 29 29 29 0a 28 66 6f 6f |quote ,f|))).(foo|
|00002170| 20 31 20 32 20 33 29 20 | 5c 65 76 20 28 66 6f 6f | 1 2 3) |\ev (foo|
|00002180| 20 31 20 32 20 33 29 0a | 0a 28 64 65 66 69 6e 65 | 1 2 3).|.(define|
|00002190| 20 31 2b 20 28 6d 61 63 | 72 6f 20 66 6f 72 6d 20 | 1+ (mac|ro form |
|000021a0| 28 6c 69 73 74 20 2b 20 | 28 63 61 64 72 20 66 6f |(list + |(cadr fo|
|000021b0| 72 6d 29 20 31 29 29 29 | 0a 28 6c 65 74 20 28 28 |rm) 1)))|.(let ((|
|000021c0| 78 20 31 29 29 20 28 31 | 2b 20 78 29 29 20 5c 65 |x 1)) (1|+ x)) \e|
|000021d0| 76 20 32 0a 5c 65 6e 64 | 7b 73 63 68 65 6d 65 7d |v 2.\end|{scheme}|
|000021e0| 0a 5c 65 6e 64 7b 65 6e | 74 72 79 7d 0a 0a 5c 62 |.\end{en|try}..\b|
|000021f0| 65 67 69 6e 7b 65 6e 74 | 72 79 7d 7b 25 0a 5c 70 |egin{ent|ry}{%.\p|
|00002200| 72 6f 74 6f 7b 6d 61 63 | 72 6f 3f 7d 7b 20 6f 62 |roto{mac|ro?}{ ob|
|00002210| 6a 7d 7b 70 72 6f 63 65 | 64 75 72 65 7d 7d 0a 5c |j}{proce|dure}}.\|
|00002220| 73 61 75 74 0a 52 65 74 | 75 72 6e 73 20 7b 5c 73 |saut.Ret|urns {\s|
|00002230| 63 68 74 72 75 65 7d 20 | 69 66 20 5c 76 61 72 7b |chtrue} |if \var{|
|00002240| 6f 62 6a 7d 20 69 73 20 | 61 20 6d 61 63 72 6f 2c |obj} is |a macro,|
|00002250| 20 6f 74 68 65 72 77 69 | 73 65 20 72 65 74 75 72 | otherwi|se retur|
|00002260| 6e 73 20 7b 5c 73 63 68 | 66 61 6c 73 65 7d 2e 0a |ns {\sch|false}..|
|00002270| 5c 65 6e 64 7b 65 6e 74 | 72 79 7d 0a 0a 5c 62 65 |\end{ent|ry}..\be|
|00002280| 67 69 6e 7b 65 6e 74 72 | 79 7d 7b 25 0a 5c 70 72 |gin{entr|y}{%.\pr|
|00002290| 6f 74 6f 7b 6d 61 63 72 | 6f 2d 65 78 70 61 6e 64 |oto{macr|o-expand|
|000022a0| 2d 31 7d 7b 20 66 6f 72 | 6d 7d 7b 70 72 6f 63 65 |-1}{ for|m}{proce|
|000022b0| 64 75 72 65 7d 0a 5c 70 | 72 6f 74 6f 7b 6d 61 63 |dure}.\p|roto{mac|
|000022c0| 72 6f 2d 65 78 70 61 6e | 64 7d 7b 20 66 6f 72 6d |ro-expan|d}{ form|
|000022d0| 7d 7b 70 72 6f 63 65 64 | 75 72 65 7d 7d 0a 5c 73 |}{proced|ure}}.\s|
|000022e0| 61 75 74 0a 5c 69 64 65 | 7b 4d 61 63 72 6f 2d 65 |aut.\ide|{Macro-e|
|000022f0| 78 70 61 6e 64 2d 31 7d | 20 72 65 74 75 72 6e 73 |xpand-1}| returns|
|00002300| 20 74 68 65 20 6d 61 63 | 72 6f 20 65 78 70 61 6e | the mac|ro expan|
|00002310| 73 69 6f 6e 20 6f 66 20 | 5c 76 61 72 7b 66 6f 72 |sion of |\var{for|
|00002320| 6d 7d 20 69 66 0a 69 74 | 20 69 73 20 61 20 6d 61 |m} if.it| is a ma|
|00002330| 63 72 6f 20 63 61 6c 6c | 2c 20 6f 74 68 65 72 77 |cro call|, otherw|
|00002340| 69 73 65 20 5c 76 61 72 | 7b 66 6f 72 6d 7d 20 69 |ise \var|{form} i|
|00002350| 73 20 72 65 74 75 72 6e | 65 64 20 75 6e 63 68 61 |s return|ed uncha|
|00002360| 6e 67 65 64 2e 20 0a 5c | 69 64 65 7b 4d 61 63 72 |nged. .\|ide{Macr|
|00002370| 6f 2d 65 78 70 61 6e 64 | 7d 20 69 73 20 73 69 6d |o-expand|} is sim|
|00002380| 69 6c 61 72 20 74 6f 20 | 5c 69 64 65 7b 6d 61 63 |ilar to |\ide{mac|
|00002390| 72 6f 2d 65 78 70 61 6e | 64 2d 31 7d 2c 20 62 75 |ro-expan|d-1}, bu|
|000023a0| 74 20 72 65 70 65 61 74 | 65 6c 79 20 0a 65 78 70 |t repeat|ely .exp|
|000023b0| 61 6e 64 20 5c 76 61 72 | 7b 66 6f 72 6d 7d 20 75 |and \var|{form} u|
|000023c0| 6e 74 69 6c 20 69 74 20 | 69 73 20 6e 6f 20 6c 6f |ntil it |is no lo|
|000023d0| 6e 67 65 72 20 61 20 6d | 61 63 72 6f 20 63 61 6c |nger a m|acro cal|
|000023e0| 6c 2e 0a 5c 62 65 67 69 | 6e 7b 73 63 68 65 6d 65 |l..\begi|n{scheme|
|000023f0| 7d 0a 28 64 65 66 69 6e | 65 20 31 2d 20 28 6d 61 |}.(defin|e 1- (ma|
|00002400| 63 72 6f 20 66 6f 72 6d | 20 60 28 2d 20 20 2c 28 |cro form| `(- ,(|
|00002410| 63 61 64 72 20 66 6f 72 | 6d 29 20 31 29 29 29 20 |cadr for|m) 1))) |
|00002420| 0a 28 64 65 66 69 6e 65 | 20 2d 2d 20 28 6d 61 63 |.(define| -- (mac|
|00002430| 72 6f 20 66 6f 72 6d 20 | 60 28 31 2d 20 2c 28 63 |ro form |`(1- ,(c|
|00002440| 61 64 72 20 66 6f 72 6d | 29 29 29 29 20 0a 28 6d |adr form|)))) .(m|
|00002450| 61 63 72 6f 2d 65 78 70 | 61 6e 64 2d 31 20 27 28 |acro-exp|and-1 '(|
|00002460| 31 2d 20 31 30 29 29 20 | 5c 65 76 20 28 2d 20 31 |1- 10)) |\ev (- 1|
|00002470| 30 20 31 29 20 0a 28 6d | 61 63 72 6f 2d 65 78 70 |0 1) .(m|acro-exp|
|00002480| 61 6e 64 20 20 20 27 28 | 31 2d 20 31 30 29 29 20 |and '(|1- 10)) |
|00002490| 5c 65 76 20 28 2d 20 31 | 30 20 31 29 20 0a 28 6d |\ev (- 1|0 1) .(m|
|000024a0| 61 63 72 6f 2d 65 78 70 | 61 6e 64 2d 31 20 27 28 |acro-exp|and-1 '(|
|000024b0| 2d 2d 20 31 30 29 29 20 | 5c 65 76 20 28 31 2d 20 |-- 10)) |\ev (1- |
|000024c0| 31 30 29 0a 28 6d 61 63 | 72 6f 2d 65 78 70 61 6e |10).(mac|ro-expan|
|000024d0| 64 20 20 20 27 28 2d 2d | 20 31 30 29 29 20 5c 65 |d '(--| 10)) \e|
|000024e0| 76 20 28 2d 20 31 30 20 | 31 29 0a 5c 65 6e 64 7b |v (- 10 |1).\end{|
|000024f0| 73 63 68 65 6d 65 7d 0a | 5c 65 6e 64 7b 65 6e 74 |scheme}.|\end{ent|
|00002500| 72 79 7d 0a 0a 5c 62 65 | 67 69 6e 7b 65 6e 74 72 |ry}..\be|gin{entr|
|00002510| 79 7d 7b 25 0a 5c 70 72 | 6f 74 6f 7b 6d 61 63 72 |y}{%.\pr|oto{macr|
|00002520| 6f 2d 65 78 70 61 6e 64 | 7d 7b 20 66 6f 72 6d 7d |o-expand|}{ form}|
|00002530| 7b 70 72 6f 63 65 64 75 | 72 65 7d 7d 0a 5c 73 61 |{procedu|re}}.\sa|
|00002540| 75 74 0a 52 65 74 75 72 | 6e 73 20 74 68 65 20 6d |ut.Retur|ns the m|
|00002550| 61 63 72 6f 20 65 78 70 | 61 6e 73 69 6f 6e 20 6f |acro exp|ansion o|
|00002560| 66 20 5c 76 61 72 7b 66 | 6f 72 6d 7d 20 69 66 20 |f \var{f|orm} if |
|00002570| 69 74 20 69 73 20 61 20 | 6d 61 63 72 6f 20 63 61 |it is a |macro ca|
|00002580| 6c 6c 2c 20 6f 74 68 65 | 72 77 69 73 65 0a 5c 76 |ll, othe|rwise.\v|
|00002590| 61 72 7b 66 6f 72 6d 7d | 20 69 73 20 72 65 74 75 |ar{form}| is retu|
|000025a0| 72 6e 65 64 20 75 6e 63 | 68 61 6e 67 65 64 2e 20 |rned unc|hanged. |
|000025b0| 4d 61 63 72 6f 20 65 78 | 70 61 6e 73 69 6f 6e 20 |Macro ex|pansion |
|000025c0| 63 6f 6e 74 69 6e 75 65 | 20 75 6e 74 69 6c 2c 20 |continue| until, |
|000025d0| 74 68 65 20 66 6f 72 6d | 0a 6f 62 74 61 69 6e 65 |the form|.obtaine|
|000025e0| 64 20 69 73 20 0a 5c 62 | 65 67 69 6e 7b 73 63 68 |d is .\b|egin{sch|
|000025f0| 65 6d 65 7d 0a 28 64 65 | 66 69 6e 65 20 31 2d 20 |eme}.(de|fine 1- |
|00002600| 28 6d 61 63 72 6f 20 66 | 6f 72 6d 20 28 6c 69 73 |(macro f|orm (lis|
|00002610| 74 20 27 2d 20 28 63 61 | 64 72 20 66 6f 72 6d 29 |t '- (ca|dr form)|
|00002620| 20 31 29 29 29 0a 28 6d | 61 63 72 6f 2d 65 78 70 | 1))).(m|acro-exp|
|00002630| 61 6e 64 20 27 28 31 2d | 20 31 30 29 29 20 5c 65 |and '(1-| 10)) \e|
|00002640| 76 20 28 2d 20 31 30 20 | 31 29 0a 5c 65 6e 64 7b |v (- 10 |1).\end{|
|00002650| 73 63 68 65 6d 65 7d 0a | 5c 65 6e 64 7b 65 6e 74 |scheme}.|\end{ent|
|00002660| 72 79 7d 0a 0a 5c 62 65 | 67 69 6e 7b 65 6e 74 72 |ry}..\be|gin{entr|
|00002670| 79 7d 7b 25 0a 5c 70 72 | 6f 74 6f 7b 6d 61 63 72 |y}{%.\pr|oto{macr|
|00002680| 6f 2d 62 6f 64 79 7d 7b | 20 6d 61 63 72 6f 7d 7b |o-body}{| macro}{|
|00002690| 70 72 6f 63 65 64 75 72 | 65 7d 7d 0a 5c 73 61 75 |procedur|e}}.\sau|
|000026a0| 74 0a 52 65 74 75 72 6e | 73 20 74 68 65 20 62 6f |t.Return|s the bo|
|000026b0| 64 79 20 6f 66 20 5c 76 | 61 72 7b 6d 61 63 72 6f |dy of \v|ar{macro|
|000026c0| 7d 0a 5c 62 65 67 69 6e | 7b 73 63 68 65 6d 65 7d |}.\begin|{scheme}|
|000026d0| 0a 28 6d 61 63 72 6f 2d | 62 6f 64 79 20 31 2b 29 |.(macro-|body 1+)|
|000026e0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000026f0| 20 5c 65 76 20 28 6d 61 | 63 72 6f 20 66 6f 72 6d | \ev (ma|cro form|
|00002700| 20 28 6c 69 73 74 20 2b | 20 28 63 61 64 72 20 66 | (list +| (cadr f|
|00002710| 6f 72 6d 29 20 31 29 29 | 0a 5c 65 6e 64 7b 73 63 |orm) 1))|.\end{sc|
|00002720| 68 65 6d 65 7d 0a 5c 65 | 6e 64 7b 65 6e 74 72 79 |heme}.\e|nd{entry|
|00002730| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 65 6e 74 72 79 7d |}..\begi|n{entry}|
|00002740| 7b 25 0a 5c 70 72 6f 74 | 6f 7b 64 65 66 69 6e 65 |{%.\prot|o{define|
|00002750| 2d 6d 61 63 72 6f 7d 7b | 20 28 5c 68 79 70 65 72 |-macro}{| (\hyper|
|00002760| 7b 6e 61 6d 65 7d 20 5c | 68 79 70 65 72 7b 66 6f |{name} \|hyper{fo|
|00002770| 72 6d 61 6c 73 7d 29 20 | 5c 68 79 70 65 72 7b 62 |rmals}) |\hyper{b|
|00002780| 6f 64 79 7d 7d 7b 6d 61 | 63 72 6f 7d 7d 0a 5c 73 |ody}}{ma|cro}}.\s|
|00002790| 61 75 74 0a 5c 69 64 65 | 7b 44 65 66 69 6e 65 2d |aut.\ide|{Define-|
|000027a0| 6d 61 63 72 6f 7d 20 69 | 73 20 61 20 6d 61 63 72 |macro} i|s a macr|
|000027b0| 6f 20 77 68 69 63 68 20 | 70 65 72 6d 69 74 73 20 |o which |permits |
|000027c0| 74 6f 20 64 65 66 69 6e | 65 20 61 20 6d 61 63 72 |to defin|e a macr|
|000027d0| 6f 20 6d 6f 72 65 20 65 | 61 73 69 6c 79 20 74 68 |o more e|asily th|
|000027e0| 61 6e 0a 77 69 74 68 20 | 74 68 65 20 5c 69 64 65 |an.with |the \ide|
|000027f0| 7b 6d 61 63 72 6f 7d 20 | 66 6f 72 6d 2e 20 49 74 |{macro} |form. It|
|00002800| 20 69 73 20 73 69 6d 69 | 6c 61 72 20 74 6f 20 74 | is simi|lar to t|
|00002810| 68 65 20 7b 5c 74 74 20 | 64 65 66 6d 61 63 72 6f |he {\tt |defmacro|
|00002820| 7d 20 6f 66 20 43 6f 6d | 6d 6f 6e 0a 4c 69 73 70 |} of Com|mon.Lisp|
|00002830| 7e 5c 63 69 74 65 7b 43 | 4c 74 4c 32 7d 2e 0a 5c |~\cite{C|LtL2}..\|
|00002840| 62 65 67 69 6e 7b 73 63 | 68 65 6d 65 7d 0a 28 64 |begin{sc|heme}.(d|
|00002850| 65 66 69 6e 65 2d 6d 61 | 63 72 6f 20 28 69 6e 63 |efine-ma|cro (inc|
|00002860| 72 20 78 29 20 60 28 73 | 65 74 21 20 2c 78 20 28 |r x) `(s|et! ,x (|
|00002870| 2b 20 2c 78 20 31 29 29 | 29 0a 28 6c 65 74 20 28 |+ ,x 1))|).(let (|
|00002880| 28 61 20 31 29 29 20 28 | 69 6e 63 72 20 61 29 20 |(a 1)) (|incr a) |
|00002890| 61 29 20 5c 65 76 20 32 | 0a 0a 28 64 65 66 69 6e |a) \ev 2|..(defin|
|000028a0| 65 2d 6d 61 63 72 6f 20 | 28 77 68 65 6e 20 74 65 |e-macro |(when te|
|000028b0| 73 74 20 2e 20 62 6f 64 | 79 29 0a 20 20 60 28 69 |st . bod|y). `(i|
|000028c0| 66 20 2c 74 65 73 74 20 | 2c 40 28 69 66 20 28 6e |f ,test |,@(if (n|
|000028d0| 75 6c 6c 3f 20 28 63 64 | 72 20 62 6f 64 79 29 29 |ull? (cd|r body))|
|000028e0| 20 62 6f 64 79 20 60 28 | 28 62 65 67 69 6e 20 2c | body `(|(begin ,|
|000028f0| 40 62 6f 64 79 29 29 29 | 29 29 0a 28 6d 61 63 72 |@body)))|)).(macr|
|00002900| 6f 2d 65 78 70 61 6e 64 | 20 27 28 77 68 65 6e 20 |o-expand| '(when |
|00002910| 61 20 62 29 29 20 5c 65 | 76 20 28 69 66 20 61 20 |a b)) \e|v (if a |
|00002920| 62 29 0a 28 6d 61 63 72 | 6f 2d 65 78 70 61 6e 64 |b).(macr|o-expand|
|00002930| 20 27 28 77 68 65 6e 20 | 61 20 62 20 63 20 64 29 | '(when |a b c d)|
|00002940| 29 20 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |) . | |
|00002950| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 5c 65 | | \e|
|00002960| 76 20 28 69 66 20 61 20 | 28 62 65 67 69 6e 20 62 |v (if a |(begin b|
|00002970| 20 63 20 64 29 29 0a 5c | 65 6e 64 7b 73 63 68 65 | c d)).\|end{sche|
|00002980| 6d 65 7d 0a 0a 5c 62 65 | 67 69 6e 7b 6e 6f 74 65 |me}..\be|gin{note|
|00002990| 7d 0a 43 61 6c 6c 73 20 | 74 6f 20 6d 61 63 72 6f |}.Calls |to macro|
|000029a0| 73 20 64 65 66 69 6e 65 | 64 20 62 79 20 5c 69 64 |s define|d by \id|
|000029b0| 65 7b 64 65 66 69 6e 65 | 2d 6d 61 63 72 6f 7d 20 |e{define|-macro} |
|000029c0| 61 72 65 20 70 68 79 73 | 69 63 61 6c 6c 79 20 72 |are phys|ically r|
|000029d0| 65 70 6c 61 63 65 64 20 | 62 79 20 74 68 65 69 72 |eplaced |by their|
|000029e0| 0a 6d 61 63 72 6f 2d 65 | 78 70 61 6e 73 69 6f 6e |.macro-e|xpansion|
|000029f0| 20 69 66 20 74 68 65 20 | 76 61 72 69 61 62 6c 65 | if the |variable|
|00002a00| 20 5c 69 64 65 7b 2a 64 | 65 62 75 67 2a 7d 20 69 | \ide{*d|ebug*} i|
|00002a10| 73 20 7b 5c 73 63 68 66 | 61 6c 73 65 7d 20 28 69 |s {\schf|alse} (i|
|00002a20| 2e 65 2e 20 74 68 65 69 | 72 20 62 6f 64 79 0a 69 |.e. thei|r body.i|
|00002a30| 73 20 60 60 69 6e 2d 6c | 69 6e 65 64 27 27 20 69 |s ``in-l|ined'' i|
|00002a40| 6e 20 74 68 65 20 6d 61 | 63 72 6f 20 63 61 6c 6c |n the ma|cro call|
|00002a50| 29 2e 20 54 6f 20 61 76 | 6f 69 64 20 74 68 69 73 |). To av|oid this|
|00002a60| 0a 66 65 61 74 75 72 65 | 2c 20 61 6e 64 20 74 6f |.feature|, and to|
|00002a70| 20 65 61 73 65 20 64 65 | 62 75 67 67 69 6e 67 2c | ease de|bugging,|
|00002a80| 20 79 6f 75 20 68 61 76 | 65 20 74 6f 20 73 65 74 | you hav|e to set|
|00002a90| 20 74 68 69 73 20 76 61 | 72 69 61 62 6c 65 20 74 | this va|riable t|
|00002aa0| 6f 20 7b 5c 73 63 68 74 | 72 75 65 7d 2e 0a 28 53 |o {\scht|rue}..(S|
|00002ab0| 65 65 20 61 6c 73 6f 20 | 5c 72 65 66 7b 75 6e 63 |ee also |\ref{unc|
|00002ac0| 6f 64 65 7d 29 2e 0a 5c | 65 6e 64 7b 6e 6f 74 65 |ode})..\|end{note|
|00002ad0| 7d 0a 5c 65 6e 64 7b 65 | 6e 74 72 79 7d 0a 0a 25 |}.\end{e|ntry}..%|
|00002ae0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002af0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002b00| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002b10| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002b20| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 0a 25 25 |%%%%%%%%|%%%%%.%%|
|00002b30| 25 25 0a 25 25 25 25 20 | 53 65 63 74 69 6f 6e 20 |%%.%%%% |Section |
|00002b40| 36 2e 31 35 3a 20 53 79 | 73 74 65 6d 20 70 72 6f |6.15: Sy|stem pro|
|00002b50| 63 65 64 75 72 65 73 0a | 25 25 25 25 0a 25 25 25 |cedures.|%%%%.%%%|
|00002b60| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002b70| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002b80| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002b90| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00002ba0| 25 25 25 25 25 25 25 25 | 25 25 25 0a 0a 5c 73 75 |%%%%%%%%|%%%..\su|
|00002bb0| 62 73 65 63 74 69 6f 6e | 7b 53 79 73 74 65 6d 20 |bsection|{System |
|00002bc0| 70 72 6f 63 65 64 75 72 | 65 73 7d 0a 0a 54 68 69 |procedur|es}..Thi|
|00002bd0| 73 20 73 65 63 74 69 6f | 6e 20 6c 69 73 74 73 20 |s sectio|n lists |
|00002be0| 61 20 73 65 74 20 6f 66 | 20 70 72 6f 63 65 64 75 |a set of| procedu|
|00002bf0| 72 65 73 20 77 68 69 63 | 68 20 70 65 72 6d 69 74 |res whic|h permit|
|00002c00| 73 20 74 6f 20 61 63 63 | 65 73 73 20 73 6f 6d 65 |s to acc|ess some|
|00002c10| 20 73 79 73 74 65 6d 0a | 69 6e 74 65 72 6e 61 6c | system.|internal|
|00002c20| 73 2e 0a 0a 0a 5c 62 65 | 67 69 6e 7b 65 6e 74 72 |s....\be|gin{entr|
|00002c30| 79 7d 7b 25 0a 5c 70 72 | 6f 74 6f 7b 65 78 70 61 |y}{%.\pr|oto{expa|
|00002c40| 6e 64 2d 66 69 6c 65 2d | 6e 61 6d 65 7d 7b 20 73 |nd-file-|name}{ s|
|00002c50| 74 72 69 6e 67 7d 20 7b | 70 72 6f 63 65 64 75 72 |tring} {|procedur|
|00002c60| 65 7d 7d 0a 5c 73 61 75 | 74 0a 5c 69 64 65 7b 45 |e}}.\sau|t.\ide{E|
|00002c70| 78 70 61 6e 64 2d 66 69 | 6c 65 2d 6e 61 6d 65 7d |xpand-fi|le-name}|
|00002c80| 20 65 78 70 61 6e 64 73 | 20 74 68 65 20 66 69 6c | expands| the fil|
|00002c90| 65 6e 61 6d 65 20 67 69 | 76 65 6e 20 69 6e 20 5c |ename gi|ven in \|
|00002ca0| 76 61 72 7b 73 74 72 69 | 6e 67 7d 20 74 6f 0a 61 |var{stri|ng} to.a|
|00002cb0| 6e 20 61 62 73 6f 6c 75 | 74 65 20 70 61 74 68 2e |n absolu|te path.|
|00002cc0| 20 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 75 | This fu|nction u|
|00002cd0| 6e 64 65 72 73 74 61 6e | 64 73 20 74 68 65 20 7b |nderstan|ds the {|
|00002ce0| 5c 65 6d 20 74 69 6c 64 | 65 0a 20 20 63 6f 6e 76 |\em tild|e. conv|
|00002cf0| 65 6e 74 69 6f 6e 7d 5c | 69 6e 64 65 78 7b 74 69 |ention}\|index{ti|
|00002d00| 6c 64 65 20 65 78 70 61 | 6e 73 69 6f 6e 7d 20 66 |lde expa|nsion} f|
|00002d10| 6f 72 20 66 69 6c 65 6e | 61 6d 65 73 2e 0a 0a 5c |or filen|ames...\|
|00002d20| 62 65 67 69 6e 7b 73 63 | 68 65 6d 65 7d 0a 3b 3b |begin{sc|heme}.;;|
|00002d30| 20 43 75 72 72 65 6e 74 | 20 64 69 72 65 63 74 6f | Current| directo|
|00002d40| 72 79 20 69 73 20 2f 75 | 73 65 72 73 2f 65 67 2f |ry is /u|sers/eg/|
|00002d50| 53 54 6b 0a 28 65 78 70 | 61 6e 64 2d 66 69 6c 65 |STk.(exp|and-file|
|00002d60| 2d 6e 61 6d 65 20 22 2e | 2e 22 29 20 5c 6c 65 76 |-name ".|.") \lev|
|00002d70| 20 22 2f 75 73 65 72 73 | 2f 65 67 22 0a 28 65 78 | "/users|/eg".(ex|
|00002d80| 70 61 6e 64 2d 66 69 6c | 65 2d 6e 61 6d 65 20 22 |pand-fil|e-name "|
|00002d90| 7b 5c 74 69 6c 64 61 7d | 72 6f 6f 74 2f 62 69 6e |{\tilda}|root/bin|
|00002da0| 29 20 5c 6c 65 76 20 22 | 2f 62 69 6e 22 0a 28 65 |) \lev "|/bin".(e|
|00002db0| 78 70 61 6e 64 2d 66 69 | 6c 65 2d 6e 61 6d 65 20 |xpand-fi|le-name |
|00002dc0| 22 7b 5c 74 69 6c 64 61 | 7d 2f 53 54 6b 29 22 20 |"{\tilda|}/STk)" |
|00002dd0| 5c 6c 65 76 20 22 2f 75 | 73 65 72 73 2f 65 67 2f |\lev "/u|sers/eg/|
|00002de0| 53 54 6b 22 0a 5c 65 6e | 64 7b 73 63 68 65 6d 65 |STk".\en|d{scheme|
|00002df0| 7d 0a 5c 65 6e 64 7b 65 | 6e 74 72 79 7d 0a 0a 5c |}.\end{e|ntry}..\|
|00002e00| 62 65 67 69 6e 7b 65 6e | 74 72 79 7d 7b 25 0a 5c |begin{en|try}{%.\|
|00002e10| 70 72 6f 74 6f 7b 63 61 | 6e 6f 6e 69 63 61 6c 2d |proto{ca|nonical-|
|00002e20| 70 61 74 68 7d 7b 20 70 | 61 74 68 7d 20 7b 70 72 |path}{ p|ath} {pr|
|00002e30| 6f 63 65 64 75 72 65 7d | 7d 0a 5c 73 61 75 74 0a |ocedure}|}.\saut.|
|00002e40| 45 78 70 61 6e 64 73 20 | 61 6c 6c 20 73 79 6d 62 |Expands |all symb|
|00002e50| 6f 6c 69 63 20 6c 69 6e | 6b 73 20 69 6e 20 5c 76 |olic lin|ks in \v|
|00002e60| 61 72 7b 70 61 74 68 7d | 20 61 6e 64 20 72 65 74 |ar{path}| and ret|
|00002e70| 75 72 6e 73 20 69 74 73 | 20 63 61 6e 6f 6e 69 63 |urns its| canonic|
|00002e80| 61 6c 69 7a 65 64 0a 61 | 62 73 6f 6c 75 74 65 20 |alized.a|bsolute |
|00002e90| 70 61 74 68 6e 61 6d 65 | 2e 20 54 68 65 20 72 65 |pathname|. The re|
|00002ea0| 73 75 6c 74 69 6e 67 20 | 70 61 74 68 20 64 6f 20 |sulting |path do |
|00002eb0| 6e 6f 74 20 68 61 76 65 | 20 73 79 6d 62 6f 6c 69 |not have| symboli|
|00002ec0| 63 20 6c 69 6e 6b 73 2e | 20 49 66 0a 5c 76 61 72 |c links.| If.\var|
|00002ed0| 7b 70 61 74 68 7d 20 64 | 6f 65 73 6e 27 74 20 64 |{path} d|oesn't d|
|00002ee0| 65 73 69 67 6e 61 74 65 | 20 61 20 76 61 6c 69 64 |esignate| a valid|
|00002ef0| 20 70 61 74 68 6e 61 6d | 65 2c 20 5c 76 61 72 7b | pathnam|e, \var{|
|00002f00| 63 61 6e 6f 6e 69 63 61 | 6c 2d 70 61 74 68 7d 20 |canonica|l-path} |
|00002f10| 72 65 74 75 72 6e 73 20 | 0a 5c 73 63 68 66 61 6c |returns |.\schfal|
|00002f20| 73 65 2e 0a 5c 65 6e 64 | 7b 65 6e 74 72 79 7d 0a |se..\end|{entry}.|
|00002f30| 0a 0a 5c 62 65 67 69 6e | 7b 65 6e 74 72 79 7d 7b |..\begin|{entry}{|
|00002f40| 25 0a 5c 70 72 6f 74 6f | 7b 64 69 72 6e 61 6d 65 |%.\proto|{dirname|
|00002f50| 7d 7b 20 73 74 72 69 6e | 67 7d 20 7b 70 72 6f 63 |}{ strin|g} {proc|
|00002f60| 65 64 75 72 65 7d 7d 0a | 5c 73 61 75 74 0a 52 65 |edure}}.|\saut.Re|
|00002f70| 74 75 72 6e 73 20 61 20 | 73 74 72 69 6e 67 20 63 |turns a |string c|
|00002f80| 6f 6e 74 61 69 6e 69 6e | 67 20 61 6c 6c 20 62 75 |ontainin|g all bu|
|00002f90| 74 20 74 68 65 20 6c 61 | 73 74 20 63 6f 6d 70 6f |t the la|st compo|
|00002fa0| 6e 65 6e 74 20 6f 66 20 | 74 68 65 20 70 61 74 68 |nent of |the path|
|00002fb0| 20 6e 61 6d 65 20 67 69 | 76 65 6e 20 69 6e 20 0a | name gi|ven in .|
|00002fc0| 5c 76 61 72 7b 73 74 72 | 69 6e 67 7d 2e 0a 5c 62 |\var{str|ing}..\b|
|00002fd0| 65 67 69 6e 7b 73 63 68 | 65 6d 65 7d 0a 28 64 69 |egin{sch|eme}.(di|
|00002fe0| 72 6e 61 6d 65 20 22 2f | 61 2f 62 2f 63 2e 73 74 |rname "/|a/b/c.st|
|00002ff0| 6b 22 29 20 5c 6c 65 76 | 20 22 2f 61 2f 62 22 0a |k") \lev| "/a/b".|
|00003000| 5c 65 6e 64 7b 73 63 68 | 65 6d 65 7d 0a 5c 65 6e |\end{sch|eme}.\en|
|00003010| 64 7b 65 6e 74 72 79 7d | 0a 0a 5c 62 65 67 69 6e |d{entry}|..\begin|
|00003020| 7b 65 6e 74 72 79 7d 7b | 25 0a 5c 70 72 6f 74 6f |{entry}{|%.\proto|
|00003030| 7b 62 61 73 65 6e 61 6d | 65 7d 7b 20 73 74 72 69 |{basenam|e}{ stri|
|00003040| 6e 67 7d 20 7b 70 72 6f | 63 65 64 75 72 65 7d 7d |ng} {pro|cedure}}|
|00003050| 0a 5c 73 61 75 74 0a 52 | 65 74 75 72 6e 73 20 61 |.\saut.R|eturns a|
|00003060| 20 73 74 72 69 6e 67 20 | 63 6f 6e 74 61 69 6e 69 | string |containi|
|00003070| 6e 67 20 74 68 65 20 6c | 61 73 74 20 63 6f 6d 70 |ng the l|ast comp|
|00003080| 6f 6e 65 6e 74 20 6f 66 | 20 74 68 65 20 70 61 74 |onent of| the pat|
|00003090| 68 20 6e 61 6d 65 20 67 | 69 76 65 6e 20 69 6e 20 |h name g|iven in |
|000030a0| 0a 5c 76 61 72 7b 73 74 | 72 69 6e 67 7d 2e 0a 5c |.\var{st|ring}..\|
|000030b0| 62 65 67 69 6e 7b 73 63 | 68 65 6d 65 7d 0a 28 62 |begin{sc|heme}.(b|
|000030c0| 61 73 6e 61 6d 65 20 22 | 2f 61 2f 62 2f 63 2e 73 |asname "|/a/b/c.s|
|000030d0| 74 6b 22 29 20 5c 6c 65 | 76 20 22 63 2e 73 74 6b |tk") \le|v "c.stk|
|000030e0| 22 0a 5c 65 6e 64 7b 73 | 63 68 65 6d 65 7d 0a 5c |".\end{s|cheme}.\|
|000030f0| 65 6e 64 7b 65 6e 74 72 | 79 7d 0a 20 0a 5c 62 65 |end{entr|y}. .\be|
|00003100| 67 69 6e 7b 65 6e 74 72 | 79 7d 7b 25 0a 5c 70 72 |gin{entr|y}{%.\pr|
|00003110| 6f 74 6f 7b 64 65 63 6f | 6d 70 6f 73 65 2d 66 69 |oto{deco|mpose-fi|
|00003120| 6c 65 2d 6e 61 6d 65 7d | 7b 20 73 74 72 69 6e 67 |le-name}|{ string|
|00003130| 7d 20 7b 70 72 6f 63 65 | 64 75 72 65 7d 7d 0a 5c |} {proce|dure}}.\|
|00003140| 73 61 75 74 0a 52 65 74 | 75 72 6e 73 20 61 6e 20 |saut.Ret|urns an |
|00003150| 60 60 65 78 70 6c 6f 64 | 65 64 27 27 20 6c 69 73 |``explod|ed'' lis|
|00003160| 74 20 6f 66 20 74 68 65 | 20 70 61 74 68 20 6e 61 |t of the| path na|
|00003170| 6d 65 20 63 6f 6d 70 6f | 6e 65 6e 74 73 20 67 69 |me compo|nents gi|
|00003180| 76 65 6e 20 69 6e 0a 5c | 76 61 72 7b 73 74 72 69 |ven in.\|var{stri|
|00003190| 6e 67 7d 2e 0a 54 68 65 | 20 66 69 72 73 74 20 65 |ng}..The| first e|
|000031a0| 6c 65 6d 65 6e 74 20 69 | 6e 20 74 68 65 20 6c 69 |lement i|n the li|
|000031b0| 73 74 20 64 65 6e 6f 74 | 65 73 20 69 66 20 74 68 |st denot|es if th|
|000031c0| 65 20 67 69 76 65 6e 20 | 5c 76 61 72 7b 73 74 72 |e given |\var{str|
|000031d0| 69 6e 67 7d 20 69 73 20 | 61 6e 0a 61 62 73 6f 6c |ing} is |an.absol|
|000031e0| 75 74 65 20 70 61 74 68 | 20 6f 72 20 61 20 72 65 |ute path| or a re|
|000031f0| 6c 61 74 69 76 65 20 6f | 6e 65 2c 20 62 65 69 6e |lative o|ne, bein|
|00003200| 67 20 7b 5c 74 74 20 22 | 2f 22 7d 20 6f 72 20 7b |g {\tt "|/"} or {|
|00003210| 5c 74 74 20 22 2e 22 7d | 20 72 65 73 70 65 63 74 |\tt "."}| respect|
|00003220| 69 76 65 6c 79 2e 0a 45 | 61 63 68 20 63 6f 6d 70 |ively..E|ach comp|
|00003230| 6f 6e 65 6e 74 20 6f 66 | 20 74 68 69 73 20 6c 69 |onent of| this li|
|00003240| 73 74 20 69 73 20 61 20 | 73 74 72 69 6e 67 2e 0a |st is a |string..|
|00003250| 5c 62 65 67 69 6e 7b 73 | 63 68 65 6d 65 7d 0a 28 |\begin{s|cheme}.(|
|00003260| 64 65 63 6f 6d 70 6f 73 | 65 2d 66 69 6c 65 2d 6e |decompos|e-file-n|
|00003270| 61 6d 65 20 22 2f 61 2f | 62 2f 63 2e 73 74 6b 22 |ame "/a/|b/c.stk"|
|00003280| 29 20 5c 6c 65 76 20 28 | 22 2f 22 20 22 61 22 20 |) \lev (|"/" "a" |
|00003290| 22 62 22 20 22 63 2e 73 | 74 6b 22 29 0a 28 64 65 |"b" "c.s|tk").(de|
|000032a0| 63 6f 6d 70 6f 73 65 2d | 66 69 6c 65 2d 6e 61 6d |compose-|file-nam|
|000032b0| 65 20 22 61 2f 62 2f 63 | 2e 73 74 6b 22 29 20 20 |e "a/b/c|.stk") |
|000032c0| 5c 6c 65 76 20 28 22 2e | 22 20 22 61 22 20 22 62 |\lev (".|" "a" "b|
|000032d0| 22 20 22 63 2e 73 74 6b | 22 29 0a 5c 65 6e 64 7b |" "c.stk|").\end{|
|000032e0| 73 63 68 65 6d 65 7d 0a | 5c 65 6e 64 7b 65 6e 74 |scheme}.|\end{ent|
|000032f0| 72 79 7d 0a 0a 5c 62 65 | 67 69 6e 7b 65 6e 74 72 |ry}..\be|gin{entr|
|00003300| 79 7d 7b 25 0a 5c 70 72 | 6f 74 6f 7b 66 69 6c 65 |y}{%.\pr|oto{file|
|00003310| 2d 69 73 2d 64 69 72 65 | 63 74 6f 72 79 3f 7d 7b |-is-dire|ctory?}{|
|00003320| 20 73 74 72 69 6e 67 7d | 20 7b 70 72 6f 63 65 64 | string}| {proced|
|00003330| 75 72 65 7d 0a 5c 70 72 | 6f 74 6f 7b 66 69 6c 65 |ure}.\pr|oto{file|
|00003340| 2d 69 73 2d 72 65 67 75 | 6c 61 72 3f 7d 7b 20 73 |-is-regu|lar?}{ s|
|00003350| 74 72 69 6e 67 7d 20 7b | 70 72 6f 63 65 64 75 72 |tring} {|procedur|
|00003360| 65 7d 0a 5c 70 72 6f 74 | 6f 7b 66 69 6c 65 2d 69 |e}.\prot|o{file-i|
|00003370| 73 2d 72 65 61 64 61 62 | 6c 65 3f 7d 7b 20 73 74 |s-readab|le?}{ st|
|00003380| 72 69 6e 67 7d 20 7b 70 | 72 6f 63 65 64 75 72 65 |ring} {p|rocedure|
|00003390| 7d 0a 5c 70 72 6f 74 6f | 7b 66 69 6c 65 2d 69 73 |}.\proto|{file-is|
|000033a0| 2d 77 72 69 74 61 62 6c | 65 3f 7d 7b 20 73 74 72 |-writabl|e?}{ str|
|000033b0| 69 6e 67 7d 20 7b 70 72 | 6f 63 65 64 75 72 65 7d |ing} {pr|ocedure}|
|000033c0| 0a 5c 70 72 6f 74 6f 7b | 66 69 6c 65 2d 69 73 2d |.\proto{|file-is-|
|000033d0| 65 78 65 63 75 74 61 62 | 6c 65 3f 7d 7b 20 73 74 |executab|le?}{ st|
|000033e0| 72 69 6e 67 7d 20 7b 70 | 72 6f 63 65 64 75 72 65 |ring} {p|rocedure|
|000033f0| 7d 0a 5c 70 72 6f 74 6f | 7b 66 69 6c 65 2d 65 78 |}.\proto|{file-ex|
|00003400| 69 73 74 73 3f 7d 7b 20 | 73 74 72 69 6e 67 7d 20 |ists?}{ |string} |
|00003410| 7b 70 72 6f 63 65 64 75 | 72 65 7d 7d 0a 5c 73 61 |{procedu|re}}.\sa|
|00003420| 75 74 0a 52 65 74 75 72 | 6e 73 20 7b 5c 73 63 68 |ut.Retur|ns {\sch|
|00003430| 74 72 75 65 7d 20 69 66 | 20 74 68 65 20 70 72 65 |true} if| the pre|
|00003440| 64 69 63 61 74 65 20 69 | 73 20 74 72 75 65 20 66 |dicate i|s true f|
|00003450| 6f 72 20 74 68 65 20 70 | 61 74 68 20 6e 61 6d 65 |or the p|ath name|
|00003460| 20 67 69 76 65 6e 20 69 | 6e 0a 5c 76 61 72 7b 73 | given i|n.\var{s|
|00003470| 74 72 69 6e 67 7d 3b 20 | 72 65 74 75 72 6e 73 20 |tring}; |returns |
|00003480| 7b 5c 73 63 68 66 61 6c | 73 65 7d 20 6f 74 68 65 |{\schfal|se} othe|
|00003490| 72 77 69 73 65 20 28 6f | 72 20 69 66 20 5c 76 61 |rwise (o|r if \va|
|000034a0| 72 7b 73 74 72 69 6e 67 | 7d 20 64 65 6e 6f 74 65 |r{string|} denote|
|000034b0| 73 20 61 20 66 69 6c 65 | 0a 77 68 69 63 68 20 64 |s a file|.which d|
|000034c0| 6f 65 73 20 6e 6f 74 20 | 65 78 69 73 74 29 2e 0a |oes not |exist)..|
|000034d0| 5c 65 6e 64 7b 65 6e 74 | 72 79 7d 0a 0a 5c 62 65 |\end{ent|ry}..\be|
|000034e0| 67 69 6e 7b 65 6e 74 72 | 79 7d 7b 25 0a 5c 70 72 |gin{entr|y}{%.\pr|
|000034f0| 6f 74 6f 7b 67 6c 6f 62 | 7d 7b 20 5c 76 72 69 7b |oto{glob|}{ \vri{|
|00003500| 70 61 74 74 65 72 6e 7d | 20 5c 76 72 69 69 7b 70 |pattern}| \vrii{p|
|00003510| 61 74 74 65 72 6e 7d 20 | 5c 64 6f 74 73 66 6f 6f |attern} |\dotsfoo|
|00003520| 7d 20 7b 70 72 6f 63 65 | 64 75 72 65 7d 7d 0a 5c |} {proce|dure}}.\|
|00003530| 73 61 75 74 0a 0a 25 25 | 25 25 25 25 25 25 25 25 |saut..%%|%%%%%%%%|
|00003540| 25 25 25 25 20 20 20 49 | 72 67 65 6e 64 77 61 6e |%%%% I|rgendwan|
|00003550| 6e 20 68 22 61 6c 74 20 | 47 6f 74 74 20 73 65 69 |n h"alt |Gott sei|
|00003560| 6e 65 20 41 72 6d 65 20 | 61 75 66 3a 0a 25 25 25 |ne Arme |auf:.%%%|
|00003570| 25 25 25 25 25 25 25 25 | 25 25 25 20 20 20 20 20 |%%%%%%%%|%%% |
|00003580| 20 20 42 49 53 20 48 49 | 45 52 48 49 4e 20 55 4e | BIS HI|ERHIN UN|
|00003590| 44 20 4e 49 43 48 54 20 | 57 45 49 54 45 52 21 0a |D NICHT |WEITER!.|
|000035a0| 0a 54 68 65 20 63 6f 64 | 65 20 66 6f 72 20 5c 69 |.The cod|e for \i|
|000035b0| 64 65 7b 67 6c 6f 62 7d | 20 69 73 20 74 61 6b 65 |de{glob}| is take|
|000035c0| 6e 20 66 72 6f 6d 20 74 | 68 65 20 54 63 6c 20 6c |n from t|he Tcl l|
|000035d0| 69 62 72 61 72 79 2e 20 | 49 74 20 70 65 72 66 6f |ibrary. |It perfo|
|000035e0| 72 6d 73 0a 66 69 6c 65 | 20 6e 61 6d 65 20 60 60 |rms.file| name ``|
|000035f0| 67 6c 6f 62 62 69 6e 67 | 27 27 20 69 6e 20 61 20 |globbing|'' in a |
|00003600| 66 61 73 68 69 6f 6e 20 | 73 69 6d 69 6c 61 72 20 |fashion |similar |
|00003610| 74 6f 20 74 68 65 20 63 | 73 68 20 73 68 65 6c 6c |to the c|sh shell|
|00003620| 2e 0a 5c 69 64 65 7b 47 | 6c 6f 62 7d 20 72 65 74 |..\ide{G|lob} ret|
|00003630| 75 72 6e 73 20 61 20 6c | 69 73 74 20 6f 66 20 74 |urns a l|ist of t|
|00003640| 68 65 20 66 69 6c 65 6e | 61 6d 65 73 20 74 68 61 |he filen|ames tha|
|00003650| 74 20 6d 61 74 63 68 20 | 61 74 20 6c 65 61 73 74 |t match |at least|
|00003660| 20 6f 6e 65 20 6f 66 0a | 74 68 65 20 7b 5c 65 6d | one of.|the {\em|
|00003670| 20 70 61 74 74 65 72 6e | 7d 20 61 72 67 75 6d 65 | pattern|} argume|
|00003680| 6e 74 73 2e 20 20 54 68 | 65 20 5c 76 61 72 7b 70 |nts. Th|e \var{p|
|00003690| 61 74 74 65 72 6e 7d 20 | 61 72 67 75 6d 65 6e 74 |attern} |argument|
|000036a0| 73 20 6d 61 79 20 63 6f | 6e 74 61 69 6e 0a 74 68 |s may co|ntain.th|
|000036b0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 73 70 65 63 |e follow|ing spec|
|000036c0| 69 61 6c 20 63 68 61 72 | 61 63 74 65 72 73 3a 0a |ial char|acters:.|
|000036d0| 0a 5c 62 65 67 69 6e 7b | 69 74 65 6d 69 7a 65 7d |.\begin{|itemize}|
|000036e0| 0a 5c 69 74 65 6d 20 3f | 20 4d 61 74 63 68 65 73 |.\item ?| Matches|
|000036f0| 20 61 6e 79 20 73 69 6e | 67 6c 65 20 63 68 61 72 | any sin|gle char|
|00003700| 61 63 74 65 72 2e 0a 5c | 69 74 65 6d 20 5c 65 74 |acter..\|item \et|
|00003710| 6f 69 6c 65 7e 4d 61 74 | 63 68 65 73 20 61 6e 79 |oile~Mat|ches any|
|00003720| 20 73 65 71 75 65 6e 63 | 65 20 6f 66 20 7a 65 72 | sequenc|e of zer|
|00003730| 6f 20 6f 72 20 6d 6f 72 | 65 20 63 68 61 72 61 63 |o or mor|e charac|
|00003740| 74 65 72 73 2e 0a 5c 69 | 74 65 6d 20 7b 5c 6c 65 |ters..\i|tem {\le|
|00003750| 66 74 62 72 61 63 6b 65 | 74 7d 63 68 61 72 73 5c |ftbracke|t}chars\|
|00003760| 72 69 67 68 74 62 72 61 | 63 6b 65 74 7e 4d 61 74 |rightbra|cket~Mat|
|00003770| 63 68 65 73 20 61 6e 79 | 20 73 69 6e 67 6c 65 20 |ches any| single |
|00003780| 63 68 61 72 61 63 74 65 | 72 20 69 6e 20 63 68 61 |characte|r in cha|
|00003790| 72 73 2e 20 0a 20 20 20 | 20 20 20 49 66 20 63 68 |rs. . | If ch|
|000037a0| 61 72 73 20 63 6f 6e 74 | 61 69 6e 73 20 61 20 73 |ars cont|ains a s|
|000037b0| 65 71 75 65 6e 63 65 20 | 6f 66 20 74 68 65 20 66 |equence |of the f|
|000037c0| 6f 72 6d 20 7b 5c 74 74 | 20 61 2d 62 7d 20 74 68 |orm {\tt| a-b} th|
|000037d0| 65 6e 20 61 6e 79 20 63 | 68 61 72 61 63 74 65 72 |en any c|haracter|
|000037e0| 20 62 65 74 77 65 65 6e | 0a 20 20 20 20 20 20 20 | between|. |
|000037f0| 7b 5c 74 74 20 61 7d 20 | 61 6e 64 20 7b 5c 74 74 |{\tt a} |and {\tt|
|00003800| 20 62 7d 20 28 69 6e 63 | 6c 75 73 69 76 65 29 20 | b} (inc|lusive) |
|00003810| 77 69 6c 6c 20 6d 61 74 | 63 68 2e 0a 5c 69 74 65 |will mat|ch..\ite|
|00003820| 6d 20 20 5c 76 65 72 62 | 2b 5c 2b 78 20 20 4d 61 |m \verb|+\+x Ma|
|00003830| 74 63 68 65 73 20 74 68 | 65 20 63 68 61 72 61 63 |tches th|e charac|
|00003840| 74 65 72 20 7b 5c 74 74 | 20 78 7d 2e 0a 5c 69 74 |ter {\tt| x}..\it|
|00003850| 65 6d 20 5c 7b 61 2c 62 | 2c 2e 2e 2e 5c 7d 20 4d |em \{a,b|,...\} M|
|00003860| 61 74 63 68 65 73 20 61 | 6e 79 20 6f 66 20 74 68 |atches a|ny of th|
|00003870| 65 20 73 74 72 69 6e 67 | 73 20 7b 5c 74 74 20 61 |e string|s {\tt a|
|00003880| 7d 2c 20 7b 5c 74 74 20 | 62 7d 2c 20 65 74 63 2e |}, {\tt |b}, etc.|
|00003890| 0a 5c 65 6e 64 7b 69 74 | 65 6d 69 7a 65 7d 0a 0a |.\end{it|emize}..|
|000038a0| 41 73 20 77 69 74 68 20 | 63 73 68 2c 20 61 20 60 |As with |csh, a `|
|000038b0| 60 2e 27 27 20 61 74 20 | 74 68 65 20 62 65 67 69 |`.'' at |the begi|
|000038c0| 6e 6e 69 6e 67 20 6f 66 | 20 61 20 66 69 6c 65 27 |nning of| a file'|
|000038d0| 73 20 6e 61 6d 65 20 6f | 72 20 6a 75 73 74 20 61 |s name o|r just a|
|000038e0| 66 74 65 72 20 61 20 60 | 60 2f 27 27 0a 6d 75 73 |fter a `|`/''.mus|
|000038f0| 74 20 62 65 20 6d 61 74 | 63 68 65 64 20 65 78 70 |t be mat|ched exp|
|00003900| 6c 69 63 69 74 6c 79 20 | 6f 72 20 77 69 74 68 20 |licitly |or with |
|00003910| 61 20 5c 7b 5c 7d 20 63 | 6f 6e 73 74 72 75 63 74 |a \{\} c|onstruct|
|00003920| 2e 20 20 49 6e 20 61 64 | 64 69 74 69 6f 6e 2c 20 |. In ad|dition, |
|00003930| 61 6c 6c 20 60 60 2f 27 | 27 0a 63 68 61 72 61 63 |all ``/'|'.charac|
|00003940| 74 65 72 73 20 6d 75 73 | 74 20 62 65 20 6d 61 74 |ters mus|t be mat|
|00003950| 63 68 65 64 20 65 78 70 | 6c 69 63 69 74 6c 79 2e |ched exp|licitly.|
|00003960| 0a 0a 49 66 20 74 68 65 | 20 66 69 72 73 74 20 63 |..If the| first c|
|00003970| 68 61 72 61 63 74 65 72 | 20 69 6e 20 61 20 70 61 |haracter| in a pa|
|00003980| 74 74 65 72 6e 20 69 73 | 20 60 60 7b 5c 74 69 6c |ttern is| ``{\til|
|00003990| 64 61 7d 27 27 20 74 68 | 65 6e 20 69 74 20 72 65 |da}'' th|en it re|
|000039a0| 66 65 72 73 20 74 6f 0a | 74 68 65 20 68 6f 6d 65 |fers to.|the home|
|000039b0| 20 64 69 72 65 63 74 6f | 72 79 20 6f 66 20 74 68 | directo|ry of th|
|000039c0| 65 20 75 73 65 72 20 77 | 68 6f 73 65 20 6e 61 6d |e user w|hose nam|
|000039d0| 65 20 66 6f 6c 6c 6f 77 | 73 20 74 68 65 20 60 60 |e follow|s the ``|
|000039e0| 7b 5c 74 69 6c 64 61 7d | 27 27 2e 0a 49 66 20 74 |{\tilda}|''..If t|
|000039f0| 68 65 20 60 60 7b 5c 74 | 69 6c 64 61 7d 27 27 20 |he ``{\t|ilda}'' |
|00003a00| 69 73 20 66 6f 6c 6c 6f | 77 65 64 20 69 6d 6d 65 |is follo|wed imme|
|00003a10| 64 69 61 74 65 6c 79 20 | 62 79 20 60 60 2f 27 27 |diately |by ``/''|
|00003a20| 20 74 68 65 6e 20 74 68 | 65 20 76 61 6c 75 65 20 | then th|e value |
|00003a30| 6f 66 0a 74 68 65 20 65 | 6e 76 69 72 6f 6e 6d 65 |of.the e|nvironme|
|00003a40| 6e 74 20 76 61 72 69 61 | 62 6c 65 20 48 4f 4d 45 |nt varia|ble HOME|
|00003a50| 20 69 73 20 75 73 65 64 | 2e 0a 0a 5c 69 64 65 7b | is used|...\ide{|
|00003a60| 47 6c 6f 62 7d 20 64 69 | 66 66 65 72 73 20 66 72 |Glob} di|ffers fr|
|00003a70| 6f 6d 20 63 73 68 20 67 | 6c 6f 62 62 69 6e 67 20 |om csh g|lobbing |
|00003a80| 69 6e 20 74 77 6f 20 77 | 61 79 73 2e 20 20 46 69 |in two w|ays. Fi|
|00003a90| 72 73 74 2c 20 69 74 20 | 64 6f 65 73 20 6e 6f 74 |rst, it |does not|
|00003aa0| 0a 73 6f 72 74 20 69 74 | 73 20 72 65 73 75 6c 74 |.sort it|s result|
|00003ab0| 20 6c 69 73 74 20 28 75 | 73 65 20 74 68 65 20 5c | list (u|se the \|
|00003ac0| 69 64 65 7b 73 6f 72 74 | 7d 20 70 72 6f 63 65 64 |ide{sort|} proced|
|00003ad0| 75 72 65 20 69 66 20 79 | 6f 75 20 77 61 6e 74 20 |ure if y|ou want |
|00003ae0| 74 68 65 20 6c 69 73 74 | 20 73 6f 72 74 65 64 29 |the list| sorted)|
|00003af0| 2e 0a 53 65 63 6f 6e 64 | 2c 20 67 6c 6f 62 20 6f |..Second|, glob o|
|00003b00| 6e 6c 79 20 72 65 74 75 | 72 6e 73 20 74 68 65 20 |nly retu|rns the |
|00003b10| 6e 61 6d 65 73 20 6f 66 | 20 66 69 6c 65 73 20 74 |names of| files t|
|00003b20| 68 61 74 20 61 63 74 75 | 61 6c 6c 79 20 65 78 69 |hat actu|ally exi|
|00003b30| 73 74 3b 20 69 6e 20 63 | 73 68 20 6e 6f 0a 63 68 |st; in c|sh no.ch|
|00003b40| 65 63 6b 20 66 6f 72 20 | 65 78 69 73 74 65 6e 63 |eck for |existenc|
|00003b50| 65 20 69 73 20 6d 61 64 | 65 20 75 6e 6c 65 73 73 |e is mad|e unless|
|00003b60| 20 61 20 70 61 74 74 65 | 72 6e 20 63 6f 6e 74 61 | a patte|rn conta|
|00003b70| 69 6e 73 20 61 20 3f 2c | 20 5c 65 74 6f 69 6c 65 |ins a ?,| \etoile|
|00003b80| 2c 20 6f 72 20 20 0a 5c | 6c 65 66 74 62 72 61 63 |, or .\|leftbrac|
|00003b90| 6b 65 74 5c 72 69 67 68 | 74 62 72 61 63 6b 65 74 |ket\righ|tbracket|
|00003ba0| 0a 63 6f 6e 73 74 72 75 | 63 74 2e 0a 5c 65 6e 64 |.constru|ct..\end|
|00003bb0| 7b 65 6e 74 72 79 7d 0a | 0a 5c 62 65 67 69 6e 7b |{entry}.|.\begin{|
|00003bc0| 65 6e 74 72 79 7d 7b 25 | 0a 5c 70 72 6f 74 6f 7b |entry}{%|.\proto{|
|00003bd0| 67 65 74 63 77 64 7d 7b | 20 73 74 72 69 6e 67 7d |getcwd}{| string}|
|00003be0| 20 7b 70 72 6f 63 65 64 | 75 72 65 7d 7d 0a 5c 73 | {proced|ure}}.\s|
|00003bf0| 61 75 74 0a 5c 69 64 65 | 7b 47 65 74 63 77 64 7d |aut.\ide|{Getcwd}|
|00003c00| 20 72 65 74 75 72 6e 73 | 20 61 20 73 74 72 69 6e | returns| a strin|
|00003c10| 67 20 63 6f 6e 74 61 69 | 6e 69 6e 67 20 74 68 65 |g contai|ning the|
|00003c20| 20 63 75 72 72 65 6e 74 | 20 77 6f 72 6b 69 6e 67 | current| working|
|00003c30| 20 64 69 72 65 63 74 6f | 72 79 2e 0a 5c 65 6e 64 | directo|ry..\end|
|00003c40| 7b 65 6e 74 72 79 7d 0a | 0a 5c 62 65 67 69 6e 7b |{entry}.|.\begin{|
|00003c50| 65 6e 74 72 79 7d 7b 25 | 0a 5c 70 72 6f 74 6f 7b |entry}{%|.\proto{|
|00003c60| 63 68 64 69 72 7d 7b 20 | 73 74 72 69 6e 67 7d 20 |chdir}{ |string} |
|00003c70| 7b 70 72 6f 63 65 64 75 | 72 65 7d 7d 0a 5c 73 61 |{procedu|re}}.\sa|
|00003c80| 75 74 0a 5c 69 64 65 7b | 43 68 64 69 72 7d 20 63 |ut.\ide{|Chdir} c|
|00003c90| 68 61 6e 67 65 73 20 74 | 68 65 20 63 75 72 72 65 |hanges t|he curre|
|00003ca0| 6e 74 20 64 69 72 65 63 | 74 6f 72 79 20 74 6f 20 |nt direc|tory to |
|00003cb0| 74 68 65 20 64 69 72 65 | 63 74 6f 72 79 20 67 69 |the dire|ctory gi|
|00003cc0| 76 65 6e 20 69 6e 0a 5c | 76 61 72 7b 73 74 72 69 |ven in.\|var{stri|
|00003cd0| 6e 67 7d 2e 0a 5c 65 6e | 64 7b 65 6e 74 72 79 7d |ng}..\en|d{entry}|
|00003ce0| 0a 0a 5c 62 65 67 69 6e | 7b 65 6e 74 72 79 7d 7b |..\begin|{entry}{|
|00003cf0| 25 0a 5c 70 72 6f 74 6f | 7b 67 65 74 70 69 64 7d |%.\proto|{getpid}|
|00003d00| 7b 20 73 74 72 69 6e 67 | 7d 20 7b 70 72 6f 63 65 |{ string|} {proce|
|00003d10| 64 75 72 65 7d 7d 0a 5c | 73 61 75 74 0a 52 65 74 |dure}}.\|saut.Ret|
|00003d20| 75 72 6e 73 20 74 68 65 | 20 73 79 73 74 65 6d 20 |urns the| system |
|00003d30| 70 72 6f 63 65 73 73 20 | 6e 75 6d 62 65 72 20 6f |process |number o|
|00003d40| 66 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 7b 5c |f the cu|rrent {\|
|00003d50| 73 74 6b 7d 20 69 6e 74 | 65 72 70 72 65 74 65 72 |stk} int|erpreter|
|00003d60| 20 28 69 2e 65 2e 20 74 | 68 65 0a 55 6e 69 78 20 | (i.e. t|he.Unix |
|00003d70| 7b 5c 65 6d 20 70 69 64 | 7d 29 2e 20 52 65 73 75 |{\em pid|}). Resu|
|00003d80| 6c 74 20 69 73 20 61 6e | 20 69 6e 74 65 67 65 72 |lt is an| integer|
|00003d90| 2e 0a 5c 65 6e 64 7b 65 | 6e 74 72 79 7d 0a 0a 5c |..\end{e|ntry}..\|
|00003da0| 62 65 67 69 6e 7b 65 6e | 74 72 79 7d 7b 25 0a 5c |begin{en|try}{%.\|
|00003db0| 70 72 6f 74 6f 7b 73 79 | 73 74 65 6d 7d 7b 20 73 |proto{sy|stem}{ s|
|00003dc0| 74 72 69 6e 67 7d 20 7b | 70 72 6f 63 65 64 75 72 |tring} {|procedur|
|00003dd0| 65 7d 0a 5c 70 72 6f 74 | 6f 7b 21 7d 7b 20 73 74 |e}.\prot|o{!}{ st|
|00003de0| 72 69 6e 67 7d 20 7b 70 | 72 6f 63 65 64 75 72 65 |ring} {p|rocedure|
|00003df0| 7d 7d 0a 5c 73 61 75 74 | 0a 53 65 6e 64 73 20 74 |}}.\saut|.Sends t|
|00003e00| 68 65 20 67 69 76 65 6e | 20 5c 76 61 72 7b 73 74 |he given| \var{st|
|00003e10| 72 69 6e 67 7d 20 74 6f | 20 74 68 65 20 73 79 73 |ring} to| the sys|
|00003e20| 74 65 6d 20 73 68 65 6c | 6c 20 5c 76 61 72 7b 2f |tem shel|l \var{/|
|00003e30| 62 69 6e 2f 73 68 7d 2e | 20 54 68 65 20 72 65 73 |bin/sh}.| The res|
|00003e40| 75 6c 74 20 6f 66 0a 5c | 69 64 65 7b 73 79 73 74 |ult of.\|ide{syst|
|00003e50| 65 6d 7d 20 69 73 20 74 | 68 65 20 69 6e 74 65 67 |em} is t|he integ|
|00003e60| 65 72 20 73 74 61 74 75 | 73 20 63 6f 64 65 20 74 |er statu|s code t|
|00003e70| 68 65 20 73 68 65 6c 6c | 20 72 65 74 75 72 6e 73 |he shell| returns|
|00003e80| 2e 0a 5c 65 6e 64 7b 65 | 6e 74 72 79 7d 0a 0a 5c |..\end{e|ntry}..\|
|00003e90| 62 65 67 69 6e 7b 65 6e | 74 72 79 7d 7b 25 0a 5c |begin{en|try}{%.\|
|00003ea0| 70 72 6f 74 6f 7b 65 78 | 65 63 7d 7b 20 73 74 72 |proto{ex|ec}{ str|
|00003eb0| 69 6e 67 7d 20 7b 70 72 | 6f 63 65 64 75 72 65 7d |ing} {pr|ocedure}|
|00003ec0| 7d 0a 5c 73 61 75 74 0a | 45 78 65 63 75 74 65 73 |}.\saut.|Executes|
|00003ed0| 20 74 68 65 20 63 6f 6d | 6d 61 6e 64 20 63 6f 6e | the com|mand con|
|00003ee0| 74 61 69 6e 65 64 20 69 | 6e 20 5c 76 61 72 7b 73 |tained i|n \var{s|
|00003ef0| 74 72 69 6e 67 7d 20 61 | 6e 64 20 72 65 64 69 72 |tring} a|nd redir|
|00003f00| 65 63 74 73 20 69 74 73 | 20 6f 75 74 70 75 74 20 |ects its| output |
|00003f10| 69 6e 0a 61 20 73 74 72 | 69 6e 67 2e 20 54 68 69 |in.a str|ing. Thi|
|00003f20| 73 20 73 74 72 69 6e 67 | 20 63 6f 6e 73 74 69 74 |s string| constit|
|00003f30| 75 74 65 73 20 74 68 65 | 20 72 65 73 75 6c 74 20 |utes the| result |
|00003f40| 6f 66 20 5c 69 64 65 7b | 65 78 65 63 7d 2e 0a 5c |of \ide{|exec}..\|
|00003f50| 65 6e 64 7b 65 6e 74 72 | 79 7d 0a 0a 5c 62 65 67 |end{entr|y}..\beg|
|00003f60| 69 6e 7b 65 6e 74 72 79 | 7d 7b 25 0a 5c 70 72 6f |in{entry|}{%.\pro|
|00003f70| 74 6f 7b 67 65 74 65 6e | 76 7d 7b 20 73 74 72 69 |to{geten|v}{ stri|
|00003f80| 6e 67 7d 20 7b 70 72 6f | 63 65 64 75 72 65 7d 7d |ng} {pro|cedure}}|
|00003f90| 0a 5c 73 61 75 74 0a 4c | 6f 6f 6b 73 20 66 6f 72 |.\saut.L|ooks for|
|00003fa0| 20 74 68 65 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 | the env|ironment|
|00003fb0| 20 76 61 72 69 61 62 6c | 65 20 6e 61 6d 65 64 20 | variabl|e named |
|00003fc0| 5c 76 61 72 7b 73 74 72 | 69 6e 67 7d 20 61 6e 64 |\var{str|ing} and|
|00003fd0| 20 72 65 74 75 72 6e 73 | 20 69 74 73 0a 76 61 6c | returns| its.val|
|00003fe0| 75 65 20 61 73 20 61 20 | 73 74 72 69 6e 67 2c 20 |ue as a |string, |
|00003ff0| 69 66 20 69 74 20 65 78 | 69 73 74 73 2e 20 4f 74 |if it ex|ists. Ot|
|00004000| 68 65 72 77 69 73 65 2c | 20 5c 69 64 65 7b 67 65 |herwise,| \ide{ge|
|00004010| 74 65 6e 76 7d 20 72 65 | 74 75 72 6e 73 0a 7b 5c |tenv} re|turns.{\|
|00004020| 73 63 68 66 61 6c 73 65 | 7d 2e 0a 5c 62 65 67 69 |schfalse|}..\begi|
|00004030| 6e 7b 73 63 68 65 6d 65 | 7d 0a 28 67 65 74 65 6e |n{scheme|}.(geten|
|00004040| 76 20 22 53 48 45 4c 4c | 22 29 20 20 20 5c 6c 65 |v "SHELL|") \le|
|00004050| 76 20 22 2f 62 69 6e 2f | 7a 73 68 22 0a 5c 65 6e |v "/bin/|zsh".\en|
|00004060| 64 7b 73 63 68 65 6d 65 | 7d 0a 5c 65 6e 64 7b 65 |d{scheme|}.\end{e|
|00004070| 6e 74 72 79 7d 0a 0a 5c | 62 65 67 69 6e 7b 65 6e |ntry}..\|begin{en|
|00004080| 74 72 79 7d 7b 25 0a 5c | 70 72 6f 74 6f 7b 73 65 |try}{%.\|proto{se|
|00004090| 74 65 6e 76 21 7d 7b 20 | 76 61 72 20 76 61 6c 75 |tenv!}{ |var valu|
|000040a0| 65 7d 20 7b 70 72 6f 63 | 65 64 75 72 65 7d 7d 0a |e} {proc|edure}}.|
|000040b0| 5c 73 61 75 74 0a 53 65 | 74 73 20 74 68 65 20 65 |\saut.Se|ts the e|
|000040c0| 6e 76 69 72 6f 6e 6d 65 | 6e 74 20 76 61 72 69 61 |nvironme|nt varia|
|000040d0| 62 6c 65 20 5c 76 61 72 | 7b 76 61 72 7d 20 74 6f |ble \var|{var} to|
|000040e0| 20 5c 76 61 72 7b 76 61 | 6c 75 65 7d 2e 20 20 5c | \var{va|lue}. \|
|000040f0| 76 61 72 7b 56 61 72 7d | 20 61 6e 64 0a 5c 76 61 |var{Var}| and.\va|
|00004100| 72 7b 76 61 6c 75 65 7d | 20 6d 75 73 74 20 62 65 |r{value}| must be|
|00004110| 20 73 74 72 69 6e 67 73 | 2e 20 54 68 65 20 72 65 | strings|. The re|
|00004120| 73 75 6c 74 20 6f 66 20 | 7b 5c 74 74 20 73 65 74 |sult of |{\tt set|
|00004130| 65 6e 76 21 7d 20 69 73 | 20 75 6e 64 65 66 69 6e |env!} is| undefin|
|00004140| 65 64 2e 0a 5c 62 65 67 | 69 6e 7b 73 63 68 65 6d |ed..\beg|in{schem|
|00004150| 65 7d 0a 28 67 65 74 65 | 6e 76 20 22 53 48 45 4c |e}.(gete|nv "SHEL|
|00004160| 4c 22 29 20 20 20 5c 6c | 65 76 20 22 2f 62 69 6e |L") \l|ev "/bin|
|00004170| 2f 7a 73 68 22 0a 5c 65 | 6e 64 7b 73 63 68 65 6d |/zsh".\e|nd{schem|
|00004180| 65 7d 0a 5c 65 6e 64 7b | 65 6e 74 72 79 7d 0a 0a |e}.\end{|entry}..|
|00004190| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000041a0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000041b0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000041c0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000041d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 0a 25 |%%%%%%%%|%%%%%%.%|
|000041e0| 25 25 25 0a 25 25 25 25 | 20 53 65 63 74 69 6f 6e |%%%.%%%%| Section|
|000041f0| 20 36 2e 31 36 3a 20 41 | 64 64 72 65 73 73 65 73 | 6.16: A|ddresses|
|00004200| 0a 25 25 25 25 0a 25 25 | 25 25 25 25 25 25 25 25 |.%%%%.%%|%%%%%%%%|
|00004210| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004220| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004230| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004240| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004250| 25 25 25 25 0a 0a 5c 73 | 75 62 73 65 63 74 69 6f |%%%%..\s|ubsectio|
|00004260| 6e 7b 41 64 64 72 65 73 | 73 65 73 7d 0a 0a 5c 6c |n{Addres|ses}..\l|
|00004270| 61 62 65 6c 7b 61 64 64 | 72 65 73 73 65 73 7d 0a |abel{add|resses}.|
|00004280| 41 6e 20 7b 5c 65 6d 20 | 61 64 64 72 65 73 73 7d |An {\em |address}|
|00004290| 20 69 73 20 61 20 53 63 | 68 65 6d 65 20 6f 62 6a | is a Sc|heme obj|
|000042a0| 65 63 74 20 77 68 69 63 | 68 20 63 6f 6e 74 61 69 |ect whic|h contai|
|000042b0| 6e 73 20 61 20 72 65 66 | 65 72 65 6e 63 65 20 74 |ns a ref|erence t|
|000042c0| 6f 0a 61 6e 6f 74 68 65 | 72 20 53 63 68 65 6d 65 |o.anothe|r Scheme|
|000042d0| 20 6f 62 6a 65 63 74 2e | 20 54 68 69 73 20 74 79 | object.| This ty|
|000042e0| 70 65 20 63 61 6e 20 62 | 65 20 76 69 65 77 65 64 |pe can b|e viewed|
|000042f0| 20 61 73 20 61 20 6b 69 | 6e 64 20 6f 66 20 70 6f | as a ki|nd of po|
|00004300| 69 6e 74 65 72 20 74 6f | 0a 61 20 53 63 68 65 6d |inter to|.a Schem|
|00004310| 65 20 6f 62 6a 65 63 74 | 2e 20 20 41 64 64 72 65 |e object|. Addre|
|00004320| 73 73 65 73 2c 20 65 76 | 65 6e 20 74 68 6f 75 67 |sses, ev|en thoug|
|00004330| 68 20 74 68 65 79 20 61 | 72 65 20 76 65 72 79 20 |h they a|re very |
|00004340| 64 61 6e 67 65 72 6f 75 | 73 2c 20 68 61 76 65 0a |dangerou|s, have.|
|00004350| 62 65 65 6e 20 69 6e 74 | 72 6f 64 75 63 65 64 20 |been int|roduced |
|00004360| 69 6e 20 7b 5c 73 74 6b | 7d 20 73 6f 20 74 68 61 |in {\stk|} so tha|
|00004370| 74 20 6f 62 6a 65 63 74 | 73 20 74 68 61 74 20 68 |t object|s that h|
|00004380| 61 76 65 20 6e 6f 20 60 | 60 72 65 61 64 61 62 6c |ave no `|`readabl|
|00004390| 65 27 27 0a 65 78 74 65 | 72 6e 61 6c 20 72 65 70 |e''.exte|rnal rep|
|000043a0| 72 65 73 65 6e 74 61 74 | 69 6f 6e 20 63 61 6e 20 |resentat|ion can |
|000043b0| 73 74 69 6c 6c 20 62 65 | 20 74 72 61 6e 73 66 6f |still be| transfo|
|000043c0| 72 6d 65 64 20 69 6e 74 | 6f 20 73 74 72 69 6e 67 |rmed int|o string|
|000043d0| 73 20 61 6e 64 20 62 61 | 63 6b 0a 77 69 74 68 6f |s and ba|ck.witho|
|000043e0| 75 74 20 6c 6f 73 73 20 | 6f 66 20 69 6e 66 6f 72 |ut loss |of infor|
|000043f0| 6d 61 74 69 6f 6e 2e 20 | 41 64 72 65 73 73 65 73 |mation. |Adresses|
|00004400| 20 77 65 72 65 20 75 73 | 65 66 75 6c 20 77 69 74 | were us|eful wit|
|00004410| 68 20 70 72 65 2d 33 2e | 30 20 76 65 72 73 69 6f |h pre-3.|0 versio|
|00004420| 6e 0a 6f 66 20 7b 5c 73 | 74 6b 7d 3b 20 74 68 65 |n.of {\s|tk}; the|
|00004430| 69 72 20 75 73 61 67 65 | 20 69 73 20 6e 6f 77 20 |ir usage| is now |
|00004440| 7b 5c 62 66 20 73 74 6f | 6e 67 6c 79 20 64 69 73 |{\bf sto|ngly dis|
|00004450| 63 6f 75 72 61 67 65 64 | 7d 2c 20 75 6e 6c 65 73 |couraged|}, unles|
|00004460| 73 20 79 6f 75 20 6b 6e | 6f 77 20 77 68 61 74 20 |s you kn|ow what |
|00004470| 79 6f 75 0a 64 6f 2e 20 | 49 6e 20 70 61 72 74 69 |you.do. |In parti|
|00004480| 63 75 6c 61 72 2c 20 61 | 6e 20 61 64 64 72 65 73 |cular, a|n addres|
|00004490| 73 20 63 61 6e 20 64 65 | 73 69 67 6e 61 74 65 20 |s can de|signate |
|000044a0| 61 6e 20 6f 62 6a 65 63 | 74 20 61 74 20 61 20 74 |an objec|t at a t|
|000044b0| 69 6d 65 20 61 6e 64 0a | 61 6e 6f 74 68 65 72 20 |ime and.|another |
|000044c0| 6f 6e 65 20 6c 61 74 65 | 72 20 28 69 2e 65 2e 20 |one late|r (i.e. |
|000044d0| 61 66 74 65 72 20 74 68 | 65 20 67 61 72 62 61 67 |after th|e garbag|
|000044e0| 65 20 63 6f 6c 6c 65 63 | 74 6f 72 20 68 61 73 20 |e collec|tor has |
|000044f0| 6d 61 72 6b 65 64 20 74 | 68 65 20 7a 6f 6e 65 0a |marked t|he zone.|
|00004500| 61 73 20 66 72 65 65 29 | 2e 0a 0a 41 64 64 72 65 |as free)|...Addre|
|00004510| 73 73 65 73 20 61 72 65 | 20 70 72 69 6e 74 65 64 |sses are| printed|
|00004520| 20 77 69 74 68 20 61 20 | 73 70 65 63 69 61 6c 20 | with a |special |
|00004530| 73 79 6e 74 61 78 3a 20 | 7b 5c 74 74 20 7b 5c 73 |syntax: |{\tt {\s|
|00004540| 68 61 72 70 73 69 67 6e | 7d 70 4e 4e 4e 7d 2c 0a |harpsign|}pNNN},.|
|00004550| 77 68 65 72 65 20 7b 5c | 74 74 20 4e 4e 4e 7d 20 |where {\|tt NNN} |
|00004560| 69 73 20 61 6e 20 68 65 | 78 61 64 65 63 69 6d 61 |is an he|xadecima|
|00004570| 6c 20 76 61 6c 75 65 2e | 20 52 65 61 64 69 6e 67 |l value.| Reading|
|00004580| 20 74 68 69 73 20 76 61 | 6c 75 65 20 62 61 63 6b | this va|lue back|
|00004590| 0a 79 69 65 6c 64 73 20 | 74 68 65 20 6f 72 69 67 |.yields |the orig|
|000045a0| 69 6e 61 6c 20 6f 62 6a | 65 63 74 20 77 68 6f 73 |inal obj|ect whos|
|000045b0| 65 20 6c 6f 63 61 74 69 | 6f 6e 20 69 73 20 7b 5c |e locati|on is {\|
|000045c0| 74 74 20 4e 4e 4e 7d 2e | 0a 0a 5c 62 65 67 69 6e |tt NNN}.|..\begin|
|000045d0| 7b 65 6e 74 72 79 7d 7b | 25 0a 5c 70 72 6f 74 6f |{entry}{|%.\proto|
|000045e0| 7b 61 64 64 72 65 73 73 | 2d 6f 66 7d 7b 20 6f 62 |{address|-of}{ ob|
|000045f0| 6a 7d 20 7b 70 72 6f 63 | 65 64 75 72 65 7d 7d 0a |j} {proc|edure}}.|
|00004600| 5c 73 61 75 74 0a 52 65 | 74 75 72 6e 73 20 74 68 |\saut.Re|turns th|
|00004610| 65 20 61 64 64 72 65 73 | 73 20 6f 66 20 5c 69 64 |e addres|s of \id|
|00004620| 65 7b 6f 62 6a 7d 2e 0a | 5c 65 6e 64 7b 65 6e 74 |e{obj}..|\end{ent|
|00004630| 72 79 7d 0a 0a 5c 62 65 | 67 69 6e 7b 65 6e 74 72 |ry}..\be|gin{entr|
|00004640| 79 7d 7b 25 0a 5c 70 72 | 6f 74 6f 7b 61 64 64 72 |y}{%.\pr|oto{addr|
|00004650| 65 73 73 3f 7d 7b 20 6f | 62 6a 7d 20 7b 70 72 6f |ess?}{ o|bj} {pro|
|00004660| 63 65 64 75 72 65 7d 7d | 0a 5c 73 61 75 74 0a 52 |cedure}}|.\saut.R|
|00004670| 65 74 75 72 6e 73 20 7b | 5c 73 63 68 74 72 75 65 |eturns {|\schtrue|
|00004680| 7d 20 69 66 20 5c 76 61 | 72 7b 6f 62 6a 7d 20 69 |} if \va|r{obj} i|
|00004690| 73 20 61 6e 20 61 64 64 | 72 65 73 73 3b 20 72 65 |s an add|ress; re|
|000046a0| 74 75 72 6e 73 20 7b 5c | 73 63 68 66 61 6c 73 65 |turns {\|schfalse|
|000046b0| 7d 20 6f 74 68 65 72 77 | 69 73 65 2e 0a 5c 65 6e |} otherw|ise..\en|
|000046c0| 64 7b 65 6e 74 72 79 7d | 0a 0a 25 25 25 25 25 25 |d{entry}|..%%%%%%|
|000046d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000046e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000046f0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004700| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004710| 25 25 25 25 25 25 25 25 | 0a 25 25 25 25 0a 25 25 |%%%%%%%%|.%%%%.%%|
|00004720| 25 25 20 53 65 63 74 69 | 6f 6e 20 36 2e 31 37 3a |%% Secti|on 6.17:|
|00004730| 20 53 69 67 6e 61 6c 73 | 0a 25 25 25 25 0a 25 25 | Signals|.%%%%.%%|
|00004740| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004750| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004760| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004770| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00004780| 25 25 25 25 25 25 25 25 | 25 25 25 25 0a 5c 73 75 |%%%%%%%%|%%%%.\su|
|00004790| 62 73 65 63 74 69 6f 6e | 7b 53 69 67 6e 61 6c 73 |bsection|{Signals|
|000047a0| 7d 0a 0a 5c 6c 61 62 65 | 6c 7b 73 69 67 6e 61 6c |}..\labe|l{signal|
|000047b0| 73 7d 0a 7b 5c 73 74 6b | 7d 20 61 6c 6c 6f 77 73 |s}.{\stk|} allows|
|000047c0| 20 74 68 65 20 75 73 65 | 20 74 6f 20 61 73 73 6f | the use| to asso|
|000047d0| 63 69 61 74 65 20 68 61 | 6e 64 6c 65 72 73 20 74 |ciate ha|ndlers t|
|000047e0| 6f 20 73 69 67 6e 61 6c | 73 2e 20 53 69 67 6e 61 |o signal|s. Signa|
|000047f0| 6c 0a 68 61 6e 64 6c 65 | 72 73 20 66 6f 72 20 61 |l.handle|rs for a|
|00004800| 20 67 69 76 65 6e 20 73 | 69 67 6e 61 6c 20 63 61 | given s|ignal ca|
|00004810| 6e 20 65 76 65 6e 20 62 | 65 20 63 68 61 69 6e 65 |n even b|e chaine|
|00004820| 64 20 69 6e 20 61 20 6c | 69 73 74 2e 20 57 68 65 |d in a l|ist. Whe|
|00004830| 6e 20 61 0a 73 69 67 6e | 61 6c 20 6f 63 63 75 72 |n a.sign|al occur|
|00004840| 73 2c 20 74 68 65 20 66 | 69 72 73 74 20 73 69 67 |s, the f|irst sig|
|00004850| 6e 61 6c 20 6f 66 20 74 | 68 65 20 6c 69 73 74 20 |nal of t|he list |
|00004860| 69 73 20 65 78 65 63 75 | 74 65 64 2e 20 55 6e 6c |is execu|ted. Unl|
|00004870| 65 73 73 20 74 68 69 73 | 0a 73 69 67 6e 61 6c 20 |ess this|.signal |
|00004880| 79 69 65 6c 64 73 20 74 | 68 65 20 73 79 6d 62 6f |yields t|he symbo|
|00004890| 6c 20 5c 69 64 65 7b 62 | 72 65 61 6b 7d 20 74 68 |l \ide{b|reak} th|
|000048a0| 65 20 6e 65 78 74 20 73 | 69 67 6e 61 6c 20 6f 66 |e next s|ignal of|
|000048b0| 20 74 68 65 20 6c 69 73 | 74 20 69 73 0a 65 76 61 | the lis|t is.eva|
|000048c0| 6c 75 61 74 65 64 2e 20 | 57 68 65 6e 20 61 20 73 |luated. |When a s|
|000048d0| 69 67 6e 61 6c 20 68 61 | 6e 64 6c 65 72 20 69 73 |ignal ha|ndler is|
|000048e0| 20 63 61 6c 6c 65 64 2c | 20 74 68 65 20 69 6e 74 | called,| the int|
|000048f0| 65 67 65 72 20 76 61 6c | 75 65 20 6f 66 20 74 68 |eger val|ue of th|
|00004900| 69 73 0a 73 69 67 6e 61 | 6c 20 69 73 20 70 61 73 |is.signa|l is pas|
|00004910| 73 65 64 20 74 6f 20 69 | 74 20 61 73 20 28 74 68 |sed to i|t as (th|
|00004920| 65 20 6f 6e 6c 79 29 20 | 70 61 72 61 6d 65 74 65 |e only) |paramete|
|00004930| 72 2e 0a 0a 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |r...The |followin|
|00004940| 67 20 50 4f 58 49 58 2e | 31 5c 6d 61 69 6e 69 6e |g POXIX.|1\mainin|
|00004950| 64 65 78 7b 50 4f 53 49 | 58 2e 31 7d 20 63 6f 6e |dex{POSI|X.1} con|
|00004960| 73 74 61 6e 74 73 20 66 | 6f 72 20 73 69 67 6e 61 |stants f|or signa|
|00004970| 6c 20 6e 75 6d 62 65 72 | 73 0a 61 72 65 20 64 65 |l number|s.are de|
|00004980| 66 69 6e 65 64 3a 20 5c | 69 64 65 7b 53 49 47 41 |fined: \|ide{SIGA|
|00004990| 42 52 54 7d 2c 20 5c 69 | 64 65 7b 53 49 47 41 4c |BRT}, \i|de{SIGAL|
|000049a0| 52 4d 7d 2c 20 5c 69 64 | 65 7b 53 49 47 46 50 45 |RM}, \id|e{SIGFPE|
|000049b0| 7d 2c 20 5c 69 64 65 7b | 53 49 47 48 55 50 7d 2c |}, \ide{|SIGHUP},|
|000049c0| 0a 5c 69 64 65 7b 53 49 | 47 49 4c 4c 7d 2c 20 5c |.\ide{SI|GILL}, \|
|000049d0| 69 64 65 7b 53 49 47 49 | 4e 54 7d 2c 20 5c 69 64 |ide{SIGI|NT}, \id|
|000049e0| 65 7b 53 49 47 4b 49 4c | 4c 7d 2c 20 5c 69 64 65 |e{SIGKIL|L}, \ide|
|000049f0| 7b 53 49 47 50 49 50 45 | 7d 2c 20 7b 5c 74 74 0a |{SIGPIPE|}, {\tt.|
|00004a00| 20 20 53 49 47 51 55 49 | 54 7d 2c 20 5c 69 64 65 | SIGQUI|T}, \ide|
|00004a10| 7b 53 49 47 53 45 47 56 | 7d 2c 20 5c 69 64 65 7b |{SIGSEGV|}, \ide{|
|00004a20| 53 49 47 54 45 52 4d 7d | 2c 20 5c 69 64 65 7b 53 |SIGTERM}|, \ide{S|
|00004a30| 49 47 55 53 52 31 7d 2c | 20 7b 5c 74 74 0a 20 20 |IGUSR1},| {\tt. |
|00004a40| 53 49 47 55 53 52 32 7d | 2c 20 5c 69 64 65 7b 53 |SIGUSR2}|, \ide{S|
|00004a50| 49 47 43 48 4c 44 7d 2c | 20 5c 69 64 65 7b 53 49 |IGCHLD},| \ide{SI|
|00004a60| 47 43 4f 4e 54 7d 2c 20 | 5c 69 64 65 7b 53 49 47 |GCONT}, |\ide{SIG|
|00004a70| 53 54 4f 50 7d 2c 20 7b | 5c 74 74 0a 20 20 53 49 |STOP}, {|\tt. SI|
|00004a80| 47 54 53 54 50 7d 2c 20 | 5c 69 64 65 7b 53 49 47 |GTSTP}, |\ide{SIG|
|00004a90| 54 54 49 4e 7d 2c 20 5c | 69 64 65 7b 53 49 47 54 |TTIN}, \|ide{SIGT|
|00004aa0| 54 4f 55 7d 2e 20 20 4d | 6f 72 65 6f 76 65 72 2c |TOU}. M|oreover,|
|00004ab0| 20 74 68 65 20 66 6f 6c | 6c 6f 77 69 6e 67 0a 63 | the fol|lowing.c|
|00004ac0| 6f 6e 73 74 61 6e 74 73 | 2c 20 77 68 69 63 68 20 |onstants|, which |
|00004ad0| 61 72 65 20 6f 66 74 65 | 6e 20 61 76 61 69 6c 61 |are ofte|n availa|
|00004ae0| 62 6c 65 20 6f 6e 20 6d | 6f 73 74 20 73 79 73 74 |ble on m|ost syst|
|00004af0| 65 6d 73 20 61 72 65 20 | 61 6c 73 6f 0a 64 65 66 |ems are |also.def|
|00004b00| 69 6e 65 64 5c 66 6f 6f | 74 6e 6f 74 65 7b 53 6f |ined\foo|tnote{So|
|00004b10| 6d 65 20 6f 66 20 74 68 | 65 73 65 20 63 6f 6e 73 |me of th|ese cons|
|00004b20| 74 61 6e 74 73 20 6d 61 | 79 20 62 65 20 75 6e 64 |tants ma|y be und|
|00004b30| 65 66 69 6e 65 64 20 69 | 66 20 74 68 65 79 20 61 |efined i|f they a|
|00004b40| 72 65 0a 20 20 6e 6f 74 | 20 73 75 70 70 6f 72 74 |re. not| support|
|00004b50| 65 64 20 62 79 20 79 6f | 75 72 20 73 79 73 74 65 |ed by yo|ur syste|
|00004b60| 6d 7d 3a 20 5c 69 64 65 | 7b 53 49 47 54 52 41 50 |m}: \ide|{SIGTRAP|
|00004b70| 7d 2c 20 5c 69 64 65 7b | 53 49 47 49 4f 54 7d 2c |}, \ide{|SIGIOT},|
|00004b80| 20 7b 5c 74 74 0a 20 20 | 53 49 47 45 4d 54 7d 2c | {\tt. |SIGEMT},|
|00004b90| 20 5c 69 64 65 7b 53 49 | 47 42 55 53 7d 2c 20 5c | \ide{SI|GBUS}, \|
|00004ba0| 69 64 65 7b 53 49 47 53 | 59 53 7d 2c 20 5c 69 64 |ide{SIGS|YS}, \id|
|00004bb0| 65 7b 53 49 47 55 52 47 | 7d 2c 20 5c 69 64 65 7b |e{SIGURG|}, \ide{|
|00004bc0| 53 49 47 43 4c 44 7d 2c | 0a 5c 69 64 65 7b 53 49 |SIGCLD},|.\ide{SI|
|00004bd0| 47 49 4f 7d 2c 20 5c 69 | 64 65 7b 53 49 47 50 4f |GIO}, \i|de{SIGPO|
|00004be0| 4c 4c 7d 2c 20 5c 69 64 | 65 7b 53 49 47 58 43 50 |LL}, \id|e{SIGXCP|
|00004bf0| 55 7d 2c 20 5c 69 64 65 | 7b 53 49 47 58 46 53 5a |U}, \ide|{SIGXFSZ|
|00004c00| 7d 2c 20 7b 5c 74 74 0a | 20 20 53 49 47 56 54 41 |}, {\tt.| SIGVTA|
|00004c10| 4c 52 4d 7d 2c 20 5c 69 | 64 65 7b 53 49 47 50 52 |LRM}, \i|de{SIGPR|
|00004c20| 4f 46 7d 2c 20 5c 69 64 | 65 7b 53 49 47 57 49 4e |OF}, \id|e{SIGWIN|
|00004c30| 43 48 7d 2c 20 5c 69 64 | 65 7b 53 49 47 4c 4f 53 |CH}, \id|e{SIGLOS|
|00004c40| 54 7d 2e 0a 0a 53 65 65 | 20 79 6f 75 72 20 55 6e |T}...See| your Un|
|00004c50| 69 78 20 64 6f 63 75 6d | 65 6e 74 61 74 69 6f 6e |ix docum|entation|
|00004c60| 20 66 6f 72 20 74 68 65 | 20 65 78 61 63 74 20 6d | for the| exact m|
|00004c70| 65 61 6e 69 6e 67 20 6f | 66 20 65 61 63 68 20 63 |eaning o|f each c|
|00004c80| 6f 6e 73 74 61 6e 74 20 | 6f 72 0a 5c 63 69 74 65 |onstant |or.\cite|
|00004c90| 7b 50 6f 73 69 78 2e 31 | 2d 39 30 7d 2e 20 55 73 |{Posix.1|-90}. Us|
|00004ca0| 65 20 73 79 6d 62 6f 6c | 69 63 20 63 6f 6e 73 74 |e symbol|ic const|
|00004cb0| 61 6e 74 73 20 72 61 74 | 68 65 72 20 74 68 61 6e |ants rat|her than|
|00004cc0| 20 74 68 65 69 72 20 6e | 75 6d 65 72 69 63 0a 76 | their n|umeric.v|
|00004cd0| 61 6c 75 65 20 69 66 20 | 79 6f 75 20 70 6c 61 6e |alue if |you plan|
|00004ce0| 20 74 6f 20 70 6f 72 74 | 20 79 6f 75 72 20 70 72 | to port| your pr|
|00004cf0| 6f 67 72 61 6d 20 6f 6e | 20 61 6e 6f 74 68 65 72 |ogram on| another|
|00004d00| 20 73 79 73 74 65 6d 2e | 0a 0a 5c 6c 61 62 65 6c | system.|..\label|
|00004d10| 7b 47 43 53 54 41 52 54 | 7d 0a 41 20 73 70 65 63 |{GCSTART|}.A spec|
|00004d20| 69 61 6c 20 73 69 67 6e | 61 6c 2c 20 6d 61 6e 61 |ial sign|al, mana|
|00004d30| 67 65 64 20 62 79 20 74 | 68 65 20 69 6e 74 65 72 |ged by t|he inter|
|00004d40| 70 72 65 74 65 72 2c 20 | 69 73 20 61 6c 73 6f 20 |preter, |is also |
|00004d50| 64 65 66 69 6e 65 64 3a | 20 7b 5c 74 74 0a 20 20 |defined:| {\tt. |
|00004d60| 53 49 47 48 41 44 47 43 | 7d 2e 20 54 68 69 73 20 |SIGHADGC|}. This |
|00004d70| 73 69 67 6e 61 6c 20 69 | 73 20 72 61 69 73 65 64 |signal i|s raised|
|00004d80| 20 77 68 65 6e 20 74 68 | 65 20 67 61 72 62 61 67 | when th|e garbag|
|00004d90| 65 20 63 6f 6c 6c 65 63 | 74 6f 72 20 70 68 61 73 |e collec|tor phas|
|00004da0| 65 0a 74 65 72 6d 69 6e | 61 74 65 73 2e 0a 0a 57 |e.termin|ates...W|
|00004db0| 68 65 6e 20 74 68 65 20 | 69 6e 74 65 72 70 72 65 |hen the |interpre|
|00004dc0| 74 65 72 20 73 74 61 72 | 74 73 20 72 75 6e 6e 69 |ter star|ts runni|
|00004dd0| 6e 67 2c 20 61 6c 6c 20 | 73 69 67 6e 61 6c 73 20 |ng, all |signals |
|00004de0| 61 72 65 20 73 65 74 73 | 20 74 6f 20 74 68 65 69 |are sets| to thei|
|00004df0| 72 0a 64 65 66 61 75 6c | 74 20 76 61 6c 75 65 2c |r.defaul|t value,|
|00004e00| 20 65 78 63 65 70 74 65 | 64 20 5c 69 64 65 7b 53 | excepte|d \ide{S|
|00004e10| 49 47 49 4e 54 7d 20 28 | 67 65 6e 65 72 61 6c 6c |IGINT} (|generall|
|00004e20| 79 20 62 6f 75 6e 64 20 | 74 6f 20 7b 5c 69 64 65 |y bound |to {\ide|
|00004e30| 0a 20 20 43 6f 6e 74 72 | 6f 6c 2d 43 7d 29 20 77 |. Contr|ol-C}) w|
|00004e40| 68 69 63 68 20 69 73 20 | 68 61 6e 64 6c 65 64 20 |hich is |handled |
|00004e50| 73 70 65 63 69 61 6c 6c | 79 2e 0a 0a 5c 62 65 67 |speciall|y...\beg|
|00004e60| 69 6e 7b 65 6e 74 72 79 | 7d 7b 25 0a 5c 70 72 6f |in{entry|}{%.\pro|
|00004e70| 74 6f 7b 73 65 74 2d 73 | 69 67 6e 61 6c 2d 68 61 |to{set-s|ignal-ha|
|00004e80| 6e 64 6c 65 72 21 7d 7b | 20 73 69 67 20 68 61 6e |ndler!}{| sig han|
|00004e90| 64 6c 65 72 7d 20 7b 70 | 72 6f 63 65 64 75 72 65 |dler} {p|rocedure|
|00004ea0| 7d 7d 0a 5c 73 61 75 74 | 0a 52 65 70 6c 61 63 65 |}}.\saut|.Replace|
|00004eb0| 20 74 68 65 20 68 61 6e | 64 6c 65 72 20 66 6f 72 | the han|dler for|
|00004ec0| 20 73 69 67 6e 61 6c 20 | 5c 76 61 72 7b 73 69 67 | signal |\var{sig|
|00004ed0| 7d 20 77 69 74 68 20 5c | 76 61 72 7b 68 61 6e 64 |} with \|var{hand|
|00004ee0| 6c 65 72 7d 2e 20 0a 48 | 61 6e 64 6c 65 72 20 63 |ler}. .H|andler c|
|00004ef0| 61 6e 20 62 65 20 0a 5c | 62 65 67 69 6e 7b 69 74 |an be .\|begin{it|
|00004f00| 65 6d 69 7a 65 7d 0a 5c | 69 74 65 6d 20 5b 2d 5d |emize}.\|item [-]|
|00004f10| 20 7b 5c 73 63 68 74 72 | 75 65 7d 20 74 6f 20 72 | {\schtr|ue} to r|
|00004f20| 65 73 65 74 20 74 68 65 | 20 73 69 67 6e 61 6c 20 |eset the| signal |
|00004f30| 68 61 6e 64 6c 65 72 20 | 66 6f 72 20 5c 76 61 72 |handler |for \var|
|00004f40| 7b 73 69 67 7d 20 74 6f | 20 74 68 65 0a 20 20 64 |{sig} to| the. d|
|00004f50| 65 66 61 75 6c 74 20 73 | 79 73 74 65 6d 20 68 61 |efault s|ystem ha|
|00004f60| 6e 64 6c 65 72 2e 0a 5c | 69 74 65 6d 20 5b 2d 5d |ndler..\|item [-]|
|00004f70| 20 7b 5c 73 63 68 66 61 | 6c 73 65 7d 20 74 6f 20 | {\schfa|lse} to |
|00004f80| 63 6f 6d 70 6c 65 74 6c | 79 20 69 67 6e 6f 72 65 |completl|y ignore|
|00004f90| 20 20 5c 76 61 72 7b 73 | 69 67 7d 20 28 4e 6f 74 | \var{s|ig} (Not|
|00004fa0| 65 20 74 68 61 74 0a 20 | 20 50 6f 73 69 78 2e 31 |e that. | Posix.1|
|00004fb0| 20 73 74 61 74 65 73 20 | 74 68 61 74 20 5c 69 64 | states |that \id|
|00004fc0| 65 7b 53 49 47 4b 49 4c | 4c 7d 20 61 6e 64 20 5c |e{SIGKIL|L} and \|
|00004fd0| 69 64 65 7b 53 49 47 53 | 54 4f 50 7d 20 63 61 6e |ide{SIGS|TOP} can|
|00004fe0| 6e 6f 74 20 62 65 20 63 | 61 75 67 68 74 0a 20 20 |not be c|aught. |
|00004ff0| 6f 72 20 69 67 6e 6f 72 | 65 64 29 2e 0a 5c 69 74 |or ignor|ed)..\it|
|00005000| 65 6d 20 5b 2d 5d 20 61 | 20 6f 6e 65 20 70 61 72 |em [-] a| one par|
|00005010| 61 6d 65 74 65 72 20 70 | 72 6f 63 65 64 75 72 65 |ameter p|rocedure|
|00005020| 2e 0a 5c 65 6e 64 7b 69 | 74 65 6d 69 7a 65 7d 0a |..\end{i|temize}.|
|00005030| 54 68 69 73 20 70 72 6f | 63 65 64 75 72 65 20 72 |This pro|cedure r|
|00005040| 65 74 75 72 6e 73 20 74 | 68 65 20 6e 65 77 20 68 |eturns t|he new h|
|00005050| 61 6e 64 6c 65 72 2c 20 | 6f 72 20 28 6c 65 6e 67 |andler, |or (leng|
|00005060| 74 68 20 31 29 20 68 61 | 6e 64 6c 65 72 20 6c 69 |th 1) ha|ndler li|
|00005070| 73 74 2c 0a 61 73 73 6f | 63 69 61 74 65 64 20 74 |st,.asso|ciated t|
|00005080| 6f 20 5c 76 61 72 7b 73 | 69 67 7d 2e 0a 0a 5c 62 |o \var{s|ig}...\b|
|00005090| 65 67 69 6e 7b 73 63 68 | 65 6d 65 7d 0a 28 6c 65 |egin{sch|eme}.(le|
|000050a0| 74 2a 20 28 28 78 20 20 | 20 20 20 20 20 5c 73 63 |t* ((x | \sc|
|000050b0| 68 66 61 6c 73 65 29 0a | 20 20 20 20 20 20 20 28 |hfalse).| (|
|000050c0| 68 61 6e 64 6c 65 72 20 | 28 6c 61 6d 62 64 61 20 |handler |(lambda |
|000050d0| 28 69 29 20 28 73 65 74 | 21 20 78 20 5c 73 63 68 |(i) (set|! x \sch|
|000050e0| 74 72 75 65 29 29 29 29 | 0a 20 20 28 73 65 74 2d |true))))|. (set-|
|000050f0| 73 69 67 6e 61 6c 2d 68 | 61 6e 64 6c 65 72 21 20 |signal-h|andler! |
|00005100| 7c 53 49 47 48 41 44 47 | 43 7c 20 68 61 6e 64 6c ||SIGHADG|C| handl|
|00005110| 65 72 29 0a 20 20 28 67 | 63 29 0a 20 20 78 29 20 |er). (g|c). x) |
|00005120| 20 5c 6c 65 76 20 5c 73 | 63 68 74 72 75 65 0a 5c | \lev \s|chtrue.\|
|00005130| 65 6e 64 7b 73 63 68 65 | 6d 65 7d 0a 5c 65 6e 64 |end{sche|me}.\end|
|00005140| 7b 65 6e 74 72 79 7d 0a | 0a 5c 62 65 67 69 6e 7b |{entry}.|.\begin{|
|00005150| 65 6e 74 72 79 7d 7b 25 | 0a 20 20 20 20 5c 70 72 |entry}{%|. \pr|
|00005160| 6f 74 6f 7b 61 64 64 2d | 73 69 67 6e 61 6c 2d 68 |oto{add-|signal-h|
|00005170| 61 6e 64 6c 65 72 21 7d | 7b 20 73 69 67 20 68 61 |andler!}|{ sig ha|
|00005180| 6e 64 6c 65 72 7d 20 7b | 70 72 6f 63 65 64 75 72 |ndler} {|procedur|
|00005190| 65 7d 7d 20 0a 5c 73 61 | 75 74 20 0a 41 64 64 73 |e}} .\sa|ut .Adds|
|000051a0| 20 5c 76 61 72 7b 68 61 | 6e 64 6c 65 72 7d 20 74 | \var{ha|ndler} t|
|000051b0| 6f 20 74 68 65 20 6c 69 | 73 74 20 6f 66 20 68 61 |o the li|st of ha|
|000051c0| 6e 64 6c 65 72 73 20 66 | 6f 72 20 73 69 67 6e 61 |ndlers f|or signa|
|000051d0| 6c 20 5c 76 61 72 7b 73 | 69 67 7d 2e 20 49 66 0a |l \var{s|ig}. If.|
|000051e0| 74 68 65 20 6f 6c 64 20 | 73 69 67 6e 61 6c 20 68 |the old |signal h|
|000051f0| 61 6e 64 6c 65 72 20 69 | 73 20 61 20 62 6f 6f 6c |andler i|s a bool|
|00005200| 65 61 6e 2c 20 74 68 69 | 73 20 70 72 6f 63 65 64 |ean, thi|s proced|
|00005210| 75 72 65 20 69 73 20 65 | 71 75 69 76 61 6c 65 6e |ure is e|quivalen|
|00005220| 74 20 74 6f 0a 5c 69 64 | 65 7b 73 65 74 2d 73 69 |t to.\id|e{set-si|
|00005230| 67 6e 61 6c 2d 68 61 6e | 64 6c 65 72 21 7d 2e 20 |gnal-han|dler!}. |
|00005240| 4f 74 68 65 72 77 69 73 | 65 2c 20 74 68 65 20 6e |Otherwis|e, the n|
|00005250| 65 77 20 68 61 6e 64 6c | 65 72 20 69 73 20 61 64 |ew handl|er is ad|
|00005260| 64 65 64 20 69 6e 0a 66 | 72 6f 6e 74 20 6f 66 20 |ded in.f|ront of |
|00005270| 74 68 65 20 70 72 65 76 | 69 6f 75 73 20 6c 69 73 |the prev|ious lis|
|00005280| 74 20 6f 66 20 68 61 6e | 64 6c 65 72 2e 20 54 68 |t of han|dler. Th|
|00005290| 69 73 20 70 72 6f 63 65 | 64 75 72 65 20 72 65 74 |is proce|dure ret|
|000052a0| 75 72 6e 73 20 74 68 65 | 20 6e 65 77 0a 68 61 6e |urns the| new.han|
|000052b0| 64 6c 65 72 2c 20 6f 72 | 20 68 61 6e 64 6c 65 72 |dler, or| handler|
|000052c0| 20 6c 69 73 74 2c 20 61 | 73 73 6f 63 69 61 74 65 | list, a|ssociate|
|000052d0| 64 20 74 6f 20 5c 76 61 | 72 7b 73 69 67 7d 2e 0a |d to \va|r{sig}..|
|000052e0| 0a 5c 62 65 67 69 6e 7b | 73 63 68 65 6d 65 7d 0a |.\begin{|scheme}.|
|000052f0| 28 6c 65 74 2a 20 28 28 | 78 20 20 20 20 20 20 20 |(let* ((|x |
|00005300| 20 27 28 29 29 0a 20 20 | 20 20 20 20 20 28 68 61 | '()). | (ha|
|00005310| 6e 64 6c 65 72 31 20 28 | 6c 61 6d 62 64 61 20 28 |ndler1 (|lambda (|
|00005320| 69 29 20 28 73 65 74 21 | 20 78 20 28 63 6f 6e 73 |i) (set!| x (cons|
|00005330| 20 31 20 78 29 29 29 29 | 0a 20 20 20 20 20 20 20 | 1 x))))|. |
|00005340| 28 68 61 6e 64 6c 65 72 | 32 20 28 6c 61 6d 62 64 |(handler|2 (lambd|
|00005350| 61 20 28 69 29 20 28 73 | 65 74 21 20 78 20 28 63 |a (i) (s|et! x (c|
|00005360| 6f 6e 73 20 32 20 78 29 | 29 29 29 29 0a 20 20 28 |ons 2 x)|)))). (|
|00005370| 61 64 64 2d 73 69 67 6e | 61 6c 2d 68 61 6e 64 6c |add-sign|al-handl|
|00005380| 65 72 21 20 7c 53 49 47 | 48 41 44 47 43 7c 20 68 |er! |SIG|HADGC| h|
|00005390| 61 6e 64 6c 65 72 31 29 | 0a 20 20 28 61 64 64 2d |andler1)|. (add-|
|000053a0| 73 69 67 6e 61 6c 2d 68 | 61 6e 64 6c 65 72 21 20 |signal-h|andler! |
|000053b0| 7c 53 49 47 48 41 44 47 | 43 7c 20 68 61 6e 64 6c ||SIGHADG|C| handl|
|000053c0| 65 72 32 29 0a 20 20 28 | 67 63 29 0a 20 20 78 29 |er2). (|gc). x)|
|000053d0| 20 20 5c 6c 65 76 20 28 | 31 20 32 29 0a 5c 65 6e | \lev (|1 2).\en|
|000053e0| 64 7b 73 63 68 65 6d 65 | 7d 0a 5c 73 61 75 74 0a |d{scheme|}.\saut.|
|000053f0| 5c 62 65 67 69 6e 7b 73 | 63 68 65 6d 65 7d 0a 28 |\begin{s|cheme}.(|
|00005400| 6c 65 74 2a 20 28 28 78 | 20 20 20 20 20 20 20 20 |let* ((x| |
|00005410| 27 28 29 29 0a 20 20 20 | 20 20 20 20 28 68 61 6e |'()). | (han|
|00005420| 64 6c 65 72 31 20 28 6c | 61 6d 62 64 61 20 28 69 |dler1 (l|ambda (i|
|00005430| 29 20 28 73 65 74 21 20 | 78 20 28 63 6f 6e 73 20 |) (set! |x (cons |
|00005440| 31 20 78 29 29 29 29 0a | 20 20 20 20 20 20 20 28 |1 x)))).| (|
|00005450| 68 61 6e 64 6c 65 72 32 | 20 28 6c 61 6d 62 64 61 |handler2| (lambda|
|00005460| 20 28 69 29 20 28 73 65 | 74 21 20 78 20 28 63 6f | (i) (se|t! x (co|
|00005470| 6e 73 20 32 20 78 29 29 | 20 27 62 72 65 61 6b 29 |ns 2 x))| 'break)|
|00005480| 29 29 0a 20 20 28 61 64 | 64 2d 73 69 67 6e 61 6c |)). (ad|d-signal|
|00005490| 2d 68 61 6e 64 6c 65 72 | 21 20 7c 53 49 47 48 41 |-handler|! |SIGHA|
|000054a0| 44 47 43 7c 20 68 61 6e | 64 6c 65 72 31 29 0a 20 |DGC| han|dler1). |
|000054b0| 20 28 61 64 64 2d 73 69 | 67 6e 61 6c 2d 68 61 6e | (add-si|gnal-han|
|000054c0| 64 6c 65 72 21 20 7c 53 | 49 47 48 41 44 47 43 7c |dler! |S|IGHADGC||
|000054d0| 20 68 61 6e 64 6c 65 72 | 32 29 0a 20 20 28 67 63 | handler|2). (gc|
|000054e0| 29 0a 20 20 78 29 20 20 | 5c 6c 65 76 20 28 32 29 |). x) |\lev (2)|
|000054f0| 0a 5c 65 6e 64 7b 73 63 | 68 65 6d 65 7d 0a 5c 65 |.\end{sc|heme}.\e|
|00005500| 6e 64 7b 65 6e 74 72 79 | 7d 0a 0a 0a 5c 62 65 67 |nd{entry|}...\beg|
|00005510| 69 6e 7b 65 6e 74 72 79 | 7d 7b 25 0a 5c 70 72 6f |in{entry|}{%.\pro|
|00005520| 74 6f 7b 67 65 74 2d 73 | 69 67 6e 61 6c 2d 68 61 |to{get-s|ignal-ha|
|00005530| 6e 64 6c 65 72 73 7d 7b | 7d 20 7b 70 72 6f 63 65 |ndlers}{|} {proce|
|00005540| 64 75 72 65 7d 0a 5c 70 | 72 6f 74 6f 7b 67 65 74 |dure}.\p|roto{get|
|00005550| 2d 73 69 67 6e 61 6c 2d | 68 61 6e 64 6c 65 72 73 |-signal-|handlers|
|00005560| 7d 7b 20 73 69 67 7d 20 | 7b 70 72 6f 63 65 64 75 |}{ sig} |{procedu|
|00005570| 72 65 7d 7d 0a 5c 73 61 | 75 74 20 0a 52 65 74 75 |re}}.\sa|ut .Retu|
|00005580| 72 6e 73 20 74 68 65 20 | 68 61 6e 64 6c 65 72 73 |rns the |handlers|
|00005590| 2c 20 6f 72 20 74 68 65 | 20 6c 69 73 74 20 6f 66 |, or the| list of|
|000055a0| 20 68 61 6e 64 6c 65 72 | 73 2c 20 61 73 73 6f 63 | handler|s, assoc|
|000055b0| 69 61 74 65 64 20 74 6f | 20 74 68 65 20 73 69 67 |iated to| the sig|
|000055c0| 6e 61 6c 0a 5c 76 61 72 | 7b 73 69 67 7d 2e 20 20 |nal.\var|{sig}. |
|000055d0| 49 66 20 5c 76 61 72 7b | 73 69 67 7d 20 69 73 20 |If \var{|sig} is |
|000055e0| 6f 6d 69 74 74 65 64 2c | 20 5c 69 64 65 7b 67 65 |omitted,| \ide{ge|
|000055f0| 74 2d 73 69 67 6e 61 6c | 2d 68 61 6e 64 6c 65 72 |t-signal|-handler|
|00005600| 73 7d 20 72 65 74 75 72 | 6e 73 0a 61 20 76 65 63 |s} retur|ns.a vec|
|00005610| 74 6f 72 20 6f 66 20 61 | 6c 6c 20 74 68 65 20 73 |tor of a|ll the s|
|00005620| 69 67 6e 61 6c 20 68 61 | 6e 64 6c 65 72 73 20 63 |ignal ha|ndlers c|
|00005630| 75 72 72 65 6e 74 6c 79 | 20 69 6e 20 65 66 66 65 |urrently| in effe|
|00005640| 63 74 2e 20 0a 5c 65 6e | 64 7b 65 6e 74 72 79 7d |ct. .\en|d{entry}|
|00005650| 0a 0a 0a 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |...%%%%%|%%%%%%%%|
|00005660| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005670| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005680| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005690| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000056a0| 25 0a 25 25 25 25 0a 25 | 25 25 25 20 53 65 63 74 |%.%%%%.%|%%% Sect|
|000056b0| 69 6f 6e 20 36 2e 31 38 | 3a 20 48 61 73 68 20 74 |ion 6.18|: Hash t|
|000056c0| 61 62 6c 65 73 0a 25 25 | 25 25 0a 25 25 25 25 25 |ables.%%|%%.%%%%%|
|000056d0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000056e0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|000056f0| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005700| 25 25 25 25 25 25 25 25 | 25 25 25 25 25 25 25 25 |%%%%%%%%|%%%%%%%%|
|00005710| 25 25 25 25 25 25 25 25 | 25 0a 0a 5c 73 75 62 73 |%%%%%%%%|%..\subs|
|00005720| 65 63 74 69 6f 6e 7b 48 | 61 73 68 20 74 61 62 6c |ection{H|ash tabl|
|00005730| 65 73 7d 0a 0a 5c 6c 61 | 62 65 6c 7b 68 61 73 68 |es}..\la|bel{hash|
|00005740| 74 61 62 6c 65 73 7d 0a | 41 20 68 61 73 68 20 74 |tables}.|A hash t|
|00005750| 61 62 6c 65 20 63 6f 6e | 73 69 73 74 73 20 6f 66 |able con|sists of|
|00005760| 20 7a 65 72 6f 20 6f 72 | 20 6d 6f 72 65 20 65 6e | zero or| more en|
|00005770| 74 72 69 65 73 2c 20 65 | 61 63 68 20 63 6f 6e 73 |tries, e|ach cons|
|00005780| 69 73 74 69 6e 67 20 6f | 66 20 61 20 6b 65 79 20 |isting o|f a key |
|00005790| 61 6e 64 20 61 0a 76 61 | 6c 75 65 2e 20 47 69 76 |and a.va|lue. Giv|
|000057a0| 65 6e 20 74 68 65 20 6b | 65 79 20 66 6f 72 20 61 |en the k|ey for a|
|000057b0| 6e 20 65 6e 74 72 79 2c | 20 74 68 65 20 68 61 73 |n entry,| the has|
|000057c0| 68 69 6e 67 20 66 75 6e | 63 74 69 6f 6e 20 63 61 |hing fun|ction ca|
|000057d0| 6e 20 76 65 72 79 20 71 | 75 69 63 6b 6c 79 0a 6c |n very q|uickly.l|
|000057e0| 6f 63 61 74 65 20 74 68 | 65 20 65 6e 74 72 79 2c |ocate th|e entry,|
|000057f0| 20 61 6e 64 20 68 65 6e | 63 65 20 74 68 65 20 63 | and hen|ce the c|
|00005800| 6f 72 72 65 73 70 6f 6e | 64 69 6e 67 20 76 61 6c |orrespon|ding val|
|00005810| 75 65 2e 20 54 68 65 72 | 65 20 6d 61 79 20 62 65 |ue. Ther|e may be|
|00005820| 20 61 74 20 6d 6f 73 74 | 20 6f 6e 65 0a 65 6e 74 | at most| one.ent|
|00005830| 72 79 20 69 6e 20 61 20 | 68 61 73 68 20 74 61 62 |ry in a |hash tab|
|00005840| 6c 65 20 77 69 74 68 20 | 61 20 70 61 72 74 69 63 |le with |a partic|
|00005850| 75 6c 61 72 20 6b 65 79 | 2c 20 62 75 74 20 6d 61 |ular key|, but ma|
|00005860| 6e 79 20 65 6e 74 72 69 | 65 73 20 6d 61 79 20 68 |ny entri|es may h|
|00005870| 61 76 65 20 74 68 65 0a | 73 61 6d 65 20 76 61 6c |ave the.|same val|
|00005880| 75 65 2e 0a 0a 7b 5c 73 | 74 6b 7d 20 68 61 73 68 |ue...{\s|tk} hash|
|00005890| 20 74 61 62 6c 65 73 20 | 67 72 6f 77 20 67 72 61 | tables |grow gra|
|000058a0| 63 65 66 75 6c 6c 79 20 | 61 73 20 74 68 65 20 6e |cefully |as the n|
|000058b0| 75 6d 62 65 72 20 6f 66 | 20 65 6e 74 72 69 65 73 |umber of| entries|
|000058c0| 20 69 6e 63 72 65 61 73 | 65 73 2c 20 73 6f 20 74 | increas|es, so t|
|000058d0| 68 61 74 0a 74 68 65 72 | 65 20 61 72 65 20 61 6c |hat.ther|e are al|
|000058e0| 77 61 79 73 20 6c 65 73 | 73 20 74 68 61 6e 20 74 |ways les|s than t|
|000058f0| 68 72 65 65 20 65 6e 74 | 72 69 65 73 20 70 65 72 |hree ent|ries per|
|00005900| 20 68 61 73 68 20 62 75 | 63 6b 65 74 2c 20 6f 6e | hash bu|cket, on|
|00005910| 20 61 76 65 72 61 67 65 | 2e 20 20 54 68 69 73 0a | average|. This.|
|00005920| 61 6c 6c 6f 77 73 20 66 | 6f 72 20 66 61 73 74 20 |allows f|or fast |
|00005930| 6c 6f 6f 6b 75 70 73 20 | 72 65 67 61 72 64 6c 65 |lookups |regardle|
|00005940| 73 73 20 6f 66 20 74 68 | 65 20 6e 75 6d 62 65 72 |ss of th|e number|
|00005950| 20 6f 66 20 65 6e 74 72 | 69 65 73 20 69 6e 20 61 | of entr|ies in a|
|00005960| 20 74 61 62 6c 65 2e 0a | 0a 5c 76 73 6b 69 70 33 | table..|.\vskip3|
|00005970| 6d 6d 0a 5c 62 65 67 69 | 6e 7b 6e 6f 74 65 7d 0a |mm.\begi|n{note}.|
|00005980| 48 61 73 68 20 74 61 62 | 6c 65 20 6d 61 6e 69 70 |Hash tab|le manip|
|00005990| 75 6c 61 74 69 6f 6e 20 | 70 72 6f 63 65 64 75 72 |ulation |procedur|
|000059a0| 65 73 20 61 72 65 20 62 | 75 69 6c 74 20 75 70 6f |es are b|uilt upo|
|000059b0| 6e 20 74 68 65 20 65 66 | 66 69 63 69 65 6e 74 20 |n the ef|ficient |
|000059c0| 54 63 6c 20 68 61 73 68 | 0a 74 61 62 6c 65 20 70 |Tcl hash|.table p|
|000059d0| 61 63 6b 61 67 65 2e 0a | 5c 65 6e 64 7b 6e 6f 74 |ackage..|\end{not|
|000059e0| 65 7d 0a 0a 5c 62 65 67 | 69 6e 7b 65 6e 74 72 79 |e}..\beg|in{entry|
|000059f0| 7d 7b 0a 5c 70 72 6f 74 | 6f 7b 6d 61 6b 65 2d 68 |}{.\prot|o{make-h|
|00005a00| 61 73 68 2d 74 61 62 6c | 65 7d 7b 7d 7b 20 70 72 |ash-tabl|e}{}{ pr|
|00005a10| 6f 63 65 64 75 72 65 7d | 0a 5c 70 72 6f 74 6f 7b |ocedure}|.\proto{|
|00005a20| 6d 61 6b 65 2d 68 61 73 | 68 2d 74 61 62 6c 65 7d |make-has|h-table}|
|00005a30| 7b 20 63 6f 6d 70 61 72 | 69 73 6f 6e 7d 7b 20 70 |{ compar|ison}{ p|
|00005a40| 72 6f 63 65 64 75 72 65 | 7d 0a 5c 70 72 6f 74 6f |rocedure|}.\proto|
|00005a50| 7b 6d 61 6b 65 2d 68 61 | 73 68 2d 74 61 62 6c 65 |{make-ha|sh-table|
|00005a60| 7d 7b 20 63 6f 6d 70 61 | 72 69 73 6f 6e 20 68 61 |}{ compa|rison ha|
|00005a70| 73 68 7d 7b 20 70 72 6f | 63 65 64 75 72 65 7d 7d |sh}{ pro|cedure}}|
|00005a80| 0a 5c 73 61 75 74 0a 5c | 69 64 65 7b 4d 61 6b 65 |.\saut.\|ide{Make|
|00005a90| 2d 68 61 73 68 2d 74 61 | 62 6c 65 7d 20 61 64 6d |-hash-ta|ble} adm|
|00005aa0| 69 74 73 20 74 68 72 65 | 65 20 64 69 66 66 65 72 |its thre|e differ|
|00005ab0| 65 6e 74 20 66 6f 72 6d | 73 2e 20 0a 54 68 65 20 |ent form|s. .The |
|00005ac0| 6d 6f 73 74 20 67 65 6e | 65 72 61 6c 20 66 6f 72 |most gen|eral for|
|00005ad0| 6d 20 61 64 6d 69 74 20 | 74 77 6f 20 61 72 67 75 |m admit |two argu|
|00005ae0| 6d 65 6e 74 73 2e 20 54 | 68 65 20 66 69 72 73 74 |ments. T|he first|
|00005af0| 20 61 72 67 75 6d 65 6e | 74 20 69 73 20 61 0a 63 | argumen|t is a.c|
|00005b00| 6f 6d 70 61 72 69 73 6f | 6e 20 66 75 6e 63 74 69 |ompariso|n functi|
|00005b10| 6f 6e 20 20 77 68 69 63 | 68 20 64 65 74 65 72 6d |on whic|h determ|
|00005b20| 69 6e 65 20 68 6f 77 20 | 6b 65 79 73 20 61 72 65 |ine how |keys are|
|00005b30| 20 63 6f 6d 70 61 72 65 | 64 3b 20 74 68 65 20 73 | compare|d; the s|
|00005b40| 65 63 6f 6e 64 0a 61 72 | 67 75 6d 65 6e 74 20 69 |econd.ar|gument i|
|00005b50| 73 20 61 20 66 75 6e 63 | 74 69 6f 6e 20 77 68 69 |s a func|tion whi|
|00005b60| 63 68 20 63 6f 6d 70 75 | 74 65 73 20 61 20 68 61 |ch compu|tes a ha|
|00005b70| 73 68 20 63 6f 64 65 20 | 66 6f 72 20 61 6e 20 6f |sh code |for an o|
|00005b80| 62 6a 65 63 74 20 61 6e | 64 0a 72 65 74 75 72 6e |bject an|d.return|
|00005b90| 73 20 74 68 65 20 68 61 | 73 68 20 63 6f 64 65 20 |s the ha|sh code |
|00005ba0| 61 73 20 61 20 6e 6f 6e | 20 6e 65 67 61 74 69 76 |as a non| negativ|
|00005bb0| 65 20 69 6e 74 65 67 65 | 72 2e 20 4f 62 6a 65 74 |e intege|r. Objet|
|00005bc0| 73 20 77 69 74 68 20 74 | 68 65 20 73 61 6d 65 0a |s with t|he same.|
|00005bd0| 68 61 73 68 20 63 6f 64 | 65 20 61 72 65 20 73 74 |hash cod|e are st|
|00005be0| 6f 72 65 64 20 69 6e 20 | 61 6e 20 41 2d 6c 69 73 |ored in |an A-lis|
|00005bf0| 74 20 72 65 67 69 73 74 | 65 72 65 64 20 69 6e 20 |t regist|ered in |
|00005c00| 74 68 65 20 62 75 63 6b | 65 74 0a 63 6f 72 72 65 |the buck|et.corre|
|00005c10| 73 70 6f 6e 64 69 6e 67 | 20 74 6f 20 74 68 65 20 |sponding| to the |
|00005c20| 6b 65 79 2e 0a 0a 49 66 | 20 6f 6d 69 74 74 65 64 |key...If| omitted|
|00005c30| 2c 20 0a 5c 62 65 67 69 | 6e 7b 69 74 65 6d 69 7a |, .\begi|n{itemiz|
|00005c40| 65 7d 0a 5c 69 74 65 6d | 20 7b 5c 74 74 20 68 61 |e}.\item| {\tt ha|
|00005c50| 73 68 7d 20 64 65 66 61 | 75 6c 74 73 20 74 6f 20 |sh} defa|ults to |
|00005c60| 74 68 65 20 5c 69 64 65 | 7b 68 61 73 68 2d 74 61 |the \ide|{hash-ta|
|00005c70| 62 6c 65 2d 68 61 73 68 | 7d 0a 70 72 6f 63 65 64 |ble-hash|}.proced|
|00005c80| 75 72 65 2e 20 0a 5c 69 | 74 65 6d 20 7b 5c 74 74 |ure. .\i|tem {\tt|
|00005c90| 20 63 6f 6d 70 61 72 69 | 73 6f 6e 20 7d 20 64 65 | compari|son } de|
|00005ca0| 66 61 75 6c 74 73 20 74 | 6f 20 74 68 65 20 5c 69 |faults t|o the \i|
|00005cb0| 64 65 7b 65 71 3f 7d 20 | 70 72 6f 63 65 64 75 72 |de{eq?} |procedur|
|00005cc0| 65 0a 5c 65 6e 64 7b 69 | 74 65 6d 69 7a 65 7d 0a |e.\end{i|temize}.|
|00005cd0| 0a 43 6f 6e 73 65 71 75 | 65 6e 74 6c 79 2c 20 0a |.Consequ|ently, .|
|00005ce0| 5c 62 65 67 69 6e 7b 73 | 63 68 65 6d 65 7d 0a 28 |\begin{s|cheme}.(|
|00005cf0| 64 65 66 69 6e 65 20 68 | 20 28 6d 61 6b 65 2d 68 |define h| (make-h|
|00005d00| 61 73 68 2d 74 61 62 6c | 65 29 29 0a 5c 65 6e 64 |ash-tabl|e)).\end|
|00005d10| 7b 73 63 68 65 6d 65 7d | 0a 69 73 20 65 71 75 69 |{scheme}|.is equi|
|00005d20| 76 61 6c 65 6e 74 20 74 | 6f 0a 5c 62 65 67 69 6e |valent t|o.\begin|
|00005d30| 7b 73 63 68 65 6d 65 7d | 0a 28 64 65 66 69 6e 65 |{scheme}|.(define|
|00005d40| 20 68 20 28 6d 61 6b 65 | 2d 68 61 73 68 2d 74 61 | h (make|-hash-ta|
|00005d50| 62 6c 65 20 65 71 3f 20 | 68 61 73 68 2d 74 61 62 |ble eq? |hash-tab|
|00005d60| 6c 65 2d 68 61 73 68 29 | 29 0a 5c 65 6e 64 7b 73 |le-hash)|).\end{s|
|00005d70| 63 68 65 6d 65 7d 0a 41 | 6e 6f 74 68 65 72 20 69 |cheme}.A|nother i|
|00005d80| 6e 74 65 72 65 73 74 69 | 6e 67 20 65 78 61 6d 70 |nteresti|ng examp|
|00005d90| 6c 65 20 69 73 20 0a 5c | 62 65 67 69 6e 7b 73 63 |le is .\|begin{sc|
|00005da0| 68 65 6d 65 7d 0a 28 64 | 65 66 69 6e 65 20 68 20 |heme}.(d|efine h |
|00005db0| 28 6d 61 6b 65 2d 68 61 | 73 68 2d 74 61 62 6c 65 |(make-ha|sh-table|
|00005dc0| 20 73 74 72 69 6e 67 2d | 63 69 3d 3f 20 73 74 72 | string-|ci=? str|
|00005dd0| 69 6e 67 2d 6c 65 6e 67 | 74 68 29 29 0a 5c 65 6e |ing-leng|th)).\en|
|00005de0| 64 7b 73 63 68 65 6d 65 | 7d 0a 77 68 69 63 68 20 |d{scheme|}.which |
|00005df0| 64 65 66 69 6e 65 73 20 | 61 20 6e 65 77 20 68 61 |defines |a new ha|
|00005e00| 73 68 20 74 61 62 6c 65 | 20 77 68 69 63 68 20 75 |sh table| which u|
|00005e10| 73 65 73 20 7b 5c 74 74 | 20 73 74 72 69 6e 67 2d |ses {\tt| string-|
|00005e20| 63 69 3d 3f 7d 20 66 6f | 72 0a 63 6f 6d 70 61 72 |ci=?} fo|r.compar|
|00005e30| 69 6e 67 20 6b 65 79 73 | 2e 20 48 65 72 65 2c 20 |ing keys|. Here, |
|00005e40| 77 65 20 75 73 65 20 74 | 68 65 20 73 74 72 69 6e |we use t|he strin|
|00005e50| 67 2d 6c 65 6e 67 74 68 | 20 61 73 20 61 20 28 76 |g-length| as a (v|
|00005e60| 65 72 79 20 73 69 6d 70 | 6c 65 29 20 0a 68 61 73 |ery simp|le) .has|
|00005e70| 68 69 6e 67 20 66 75 6e | 63 74 69 6f 6e 2e 20 4f |hing fun|ction. O|
|00005e80| 66 20 63 6f 75 72 73 65 | 2c 20 61 20 66 75 6e 63 |f course|, a func|
|00005e90| 74 69 6f 6e 20 77 68 69 | 63 68 20 67 69 76 65 73 |tion whi|ch gives|
|00005ea0| 20 61 20 6b 65 79 20 64 | 65 70 65 6e 64 69 6e 67 | a key d|epending|
|00005eb0| 20 0a 6f 66 20 74 68 65 | 20 63 68 61 72 61 63 74 | .of the| charact|
|00005ec0| 65 72 73 20 63 6f 6d 70 | 6f 73 69 6e 67 20 74 68 |ers comp|osing th|
|00005ed0| 65 20 73 74 72 69 6e 67 | 20 67 69 76 65 73 20 61 |e string| gives a|
|00005ee0| 20 62 65 74 74 65 72 20 | 72 65 70 61 72 74 69 74 | better |repartit|
|00005ef0| 69 6f 6e 0a 61 6e 64 20 | 73 68 6f 75 6c 64 20 70 |ion.and |should p|
|00005f00| 72 6f 62 61 62 6c 79 20 | 65 6e 68 61 6e 63 65 20 |robably |enhance |
|00005f10| 70 65 72 66 6f 72 6d 61 | 6e 63 65 73 2e 20 46 6f |performa|nces. Fo|
|00005f20| 72 20 69 6e 73 74 61 6e | 63 65 2c 20 74 68 65 20 |r instan|ce, the |
|00005f30| 66 6f 6c 6c 6f 77 69 6e | 67 0a 63 61 6c 6c 20 74 |followin|g.call t|
|00005f40| 6f 20 7b 5c 74 74 20 6d | 61 6b 65 2d 68 61 73 68 |o {\tt m|ake-hash|
|00005f50| 2d 74 61 62 6c 65 7d 20 | 73 68 6f 75 6c 64 20 72 |-table} |should r|
|00005f60| 65 74 75 72 6e 20 61 20 | 6d 6f 72 65 20 65 66 66 |eturn a |more eff|
|00005f70| 69 63 69 65 6e 74 2c 20 | 65 76 65 6e 20 69 66 0a |icient, |even if.|
|00005f80| 6e 6f 74 20 70 65 72 66 | 65 63 74 2c 20 68 61 73 |not perf|ect, has|
|00005f90| 68 20 74 61 62 6c 65 3a | 0a 5c 62 65 67 69 6e 7b |h table:|.\begin{|
|00005fa0| 73 63 68 65 6d 65 7d 0a | 28 6d 61 6b 65 2d 68 61 |scheme}.|(make-ha|
|00005fb0| 73 68 2d 74 61 62 6c 65 | 20 0a 20 20 20 20 73 74 |sh-table| . st|
|00005fc0| 72 69 6e 67 2d 63 69 3d | 3f 20 0a 20 20 20 20 28 |ring-ci=|? . (|
|00005fd0| 6c 61 6d 62 64 61 20 28 | 73 29 0a 20 20 20 20 20 |lambda (|s). |
|00005fe0| 20 28 6c 65 74 20 28 28 | 6c 65 6e 20 28 73 74 72 | (let ((|len (str|
|00005ff0| 69 6e 67 2d 6c 65 6e 67 | 74 68 20 73 29 29 29 0a |ing-leng|th s))).|
|00006000| 20 20 20 20 20 20 20 20 | 28 64 6f 20 28 28 68 20 | |(do ((h |
|00006010| 30 29 20 20 28 69 20 30 | 20 28 2b 20 69 20 31 29 |0) (i 0| (+ i 1)|
|00006020| 29 29 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 28 |)). | (|
|00006030| 28 3d 20 69 20 6c 65 6e | 29 20 68 29 0a 20 20 20 |(= i len|) h). |
|00006040| 20 20 20 20 20 20 20 28 | 73 65 74 21 20 68 20 28 | (|set! h (|
|00006050| 2b 20 68 20 28 63 68 61 | 72 2d 3e 69 6e 74 65 67 |+ h (cha|r->integ|
|00006060| 65 72 20 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |er . | |
|00006070| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 28 63 68 | | (ch|
|00006080| 61 72 2d 64 6f 77 6e 63 | 61 73 65 20 28 73 74 72 |ar-downc|ase (str|
|00006090| 69 6e 67 2d 72 65 66 20 | 73 20 69 29 29 29 29 29 |ing-ref |s i)))))|
|000060a0| 29 29 29 29 0a 5c 65 6e | 64 7b 73 63 68 65 6d 65 |)))).\en|d{scheme|
|000060b0| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 6e 6f 74 65 7d 0a |}..\begi|n{note}.|
|000060c0| 48 61 73 68 20 74 61 62 | 6c 65 73 20 77 69 74 68 |Hash tab|les with|
|000060d0| 20 61 20 63 6f 6d 70 61 | 72 69 73 6f 6e 20 66 75 | a compa|rison fu|
|000060e0| 6e 63 74 69 6f 6e 20 65 | 71 75 61 6c 20 74 6f 20 |nction e|qual to |
|000060f0| 5c 69 64 65 7b 65 71 3f | 7d 20 6f 72 20 7b 5c 74 |\ide{eq?|} or {\t|
|00006100| 74 0a 73 74 72 69 6e 67 | 3d 3f 7d 20 61 72 65 20 |t.string|=?} are |
|00006110| 68 61 6e 64 6c 65 64 20 | 69 6e 20 61 6e 20 6d 6f |handled |in an mo|
|00006120| 72 65 20 65 66 66 69 63 | 69 65 6e 74 20 77 61 79 |re effic|ient way|
|00006130| 20 28 69 6e 20 66 61 63 | 74 2c 20 74 68 65 79 0a | (in fac|t, they.|
|00006140| 64 6f 6e 27 74 20 75 73 | 65 20 74 68 65 20 5c 69 |don't us|e the \i|
|00006150| 64 65 7b 68 61 73 68 2d | 74 61 62 6c 65 2d 68 61 |de{hash-|table-ha|
|00006160| 73 68 7d 20 66 75 63 6e | 74 69 6f 6e 20 74 6f 20 |sh} fucn|tion to |
|00006170| 73 70 65 65 64 20 75 70 | 20 68 61 73 68 20 74 61 |speed up| hash ta|
|00006180| 62 6c 65 0a 72 65 74 72 | 69 65 76 61 6c 73 29 2e |ble.retr|ievals).|
|00006190| 0a 5c 65 6e 64 7b 6e 6f | 74 65 7d 0a 5c 65 6e 64 |.\end{no|te}.\end|
|000061a0| 7b 65 6e 74 72 79 7d 0a | 20 0a 5c 62 65 67 69 6e |{entry}.| .\begin|
|000061b0| 7b 65 6e 74 72 79 7d 7b | 0a 5c 70 72 6f 74 6f 7b |{entry}{|.\proto{|
|000061c0| 68 61 73 68 2d 74 61 62 | 6c 65 3f 7d 7b 20 6f 62 |hash-tab|le?}{ ob|
|000061d0| 6a 7d 7b 20 70 72 6f 63 | 65 64 75 72 65 7d 7d 0a |j}{ proc|edure}}.|
|000061e0| 5c 73 61 75 74 0a 52 65 | 74 75 72 6e 73 20 7b 5c |\saut.Re|turns {\|
|000061f0| 73 63 68 74 72 75 65 7d | 20 69 66 20 5c 76 61 72 |schtrue}| if \var|
|00006200| 7b 6f 62 6a 7d 20 69 73 | 20 61 20 68 61 73 68 20 |{obj} is| a hash |
|00006210| 74 61 62 6c 65 2c 20 72 | 65 74 75 72 6e 73 20 7b |table, r|eturns {|
|00006220| 5c 73 63 68 66 61 6c 73 | 65 7d 20 6f 74 68 65 72 |\schfals|e} other|
|00006230| 77 69 73 65 2e 0a 5c 65 | 6e 64 7b 65 6e 74 72 79 |wise..\e|nd{entry|
|00006240| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 65 6e 74 72 79 7d |}..\begi|n{entry}|
|00006250| 7b 0a 5c 70 72 6f 74 6f | 7b 68 61 73 68 2d 74 61 |{.\proto|{hash-ta|
|00006260| 62 6c 65 2d 68 61 73 68 | 7d 7b 20 6f 62 6a 7d 7b |ble-hash|}{ obj}{|
|00006270| 20 70 72 6f 63 65 64 75 | 72 65 7d 7d 0a 5c 73 61 | procedu|re}}.\sa|
|00006280| 75 74 0a 5c 69 64 65 7b | 68 61 73 68 2d 74 61 62 |ut.\ide{|hash-tab|
|00006290| 6c 65 2d 68 61 73 68 7d | 20 63 6f 6d 70 75 74 65 |le-hash}| compute|
|000062a0| 73 20 61 20 68 61 73 68 | 20 63 6f 64 65 20 66 6f |s a hash| code fo|
|000062b0| 72 20 61 6e 20 6f 62 6a | 65 63 74 20 61 6e 64 20 |r an obj|ect and |
|000062c0| 72 65 74 75 72 6e 73 0a | 74 68 65 20 68 61 73 68 |returns.|the hash|
|000062d0| 20 63 6f 64 65 20 61 73 | 20 61 20 6e 6f 6e 20 6e | code as| a non n|
|000062e0| 65 67 61 74 69 76 65 20 | 69 6e 74 65 67 65 72 2e |egative |integer.|
|000062f0| 20 41 20 70 72 6f 70 65 | 72 74 79 20 6f 66 20 7b | A prope|rty of {|
|00006300| 5c 74 74 0a 68 61 73 68 | 2d 74 61 62 6c 65 2d 68 |\tt.hash|-table-h|
|00006310| 61 73 68 7d 20 69 73 20 | 74 68 61 74 20 0a 5c 62 |ash} is |that .\b|
|00006320| 65 67 69 6e 7b 71 75 6f | 74 65 7d 0a 7b 5c 74 74 |egin{quo|te}.{\tt|
|00006330| 20 28 65 71 75 61 6c 3f | 20 78 20 79 29 7d 20 69 | (equal?| x y)} i|
|00006340| 6d 70 6c 69 65 73 20 7b | 5c 74 74 20 28 65 71 75 |mplies {|\tt (equ|
|00006350| 61 6c 3f 20 28 68 61 73 | 68 2d 74 61 62 6c 65 2d |al? (has|h-table-|
|00006360| 68 61 73 68 20 78 29 20 | 28 68 61 73 68 2d 74 61 |hash x) |(hash-ta|
|00006370| 62 6c 65 2d 68 61 73 68 | 20 79 29 7d 0a 5c 65 6e |ble-hash| y)}.\en|
|00006380| 64 7b 71 75 6f 74 65 7d | 0a 61 73 20 74 68 65 20 |d{quote}|.as the |
|00006390| 74 68 65 20 43 6f 6d 6d | 6f 6e 20 4c 69 73 70 20 |the Comm|on Lisp |
|000063a0| 7b 5c 74 74 20 73 78 68 | 61 73 68 7d 20 66 75 6e |{\tt sxh|ash} fun|
|000063b0| 63 74 69 6f 6e 20 66 72 | 6f 6d 20 77 68 69 63 68 |ction fr|om which|
|000063c0| 20 74 68 69 73 20 70 72 | 6f 63 65 64 75 72 65 20 | this pr|ocedure |
|000063d0| 69 73 0a 6d 6f 64 65 6c | 65 64 2e 0a 5c 65 6e 64 |is.model|ed..\end|
|000063e0| 7b 65 6e 74 72 79 7d 0a | 0a 5c 62 65 67 69 6e 7b |{entry}.|.\begin{|
|000063f0| 65 6e 74 72 79 7d 7b 0a | 5c 70 72 6f 74 6f 7b 68 |entry}{.|\proto{h|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.